summaryrefslogtreecommitdiffstats
path: root/mm-video-v4l2/vidc/vdec
diff options
context:
space:
mode:
authorLeena Winterrowd <lenhardw@codeaurora.org>2014-08-05 18:04:25 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2014-11-19 00:33:42 -0800
commitd139fdc1d1f10da49f776f84044643c81563d012 (patch)
treea87eba67467c2ad7cc229baecb42c7189cad3ad9 /mm-video-v4l2/vidc/vdec
parent4fc4ca4e870f5b9ded7a87a49f14a3f1f6e49b59 (diff)
downloadandroid_hardware_qcom_media-d139fdc1d1f10da49f776f84044643c81563d012.tar.gz
android_hardware_qcom_media-d139fdc1d1f10da49f776f84044643c81563d012.tar.bz2
android_hardware_qcom_media-d139fdc1d1f10da49f776f84044643c81563d012.zip
mm-video-v4l2: vidc: Enforce non-negative timestamp deltas
When in display order, timestamps should never step backwards during normal playback, but this may occur if timestamp adjustment overestimates the frame interval. In such cases, return the previous timestamp again. Change-Id: If04d2fc98eed517ceda2300a1463dc65d641348f
Diffstat (limited to 'mm-video-v4l2/vidc/vdec')
-rw-r--r--mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
index 09d1b0e8..6e3ac44a 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
@@ -8456,8 +8456,13 @@ void omx_vdec::adjust_timestamp(OMX_S64 &act_timestamp)
act_timestamp = prev_ts + frm_int;
DEBUG_PRINT_LOW("adjust_timestamp: predicted ts[%lld]", act_timestamp);
prev_ts = act_timestamp;
- } else
+ } else {
+ if (drv_ctx.picture_order == VDEC_ORDER_DISPLAY && act_timestamp < prev_ts) {
+ // ensure that timestamps can never step backwards when in display order
+ act_timestamp = prev_ts;
+ }
set_frame_rate(act_timestamp);
+ }
} else if (frm_int > 0) // In this case the frame rate was set along
{ // with the port definition, start ts with 0
act_timestamp = prev_ts = 0; // and correct if a valid ts is received.