diff options
author | Leena Winterrowd <lenhardw@codeaurora.org> | 2014-08-05 18:04:25 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-11-19 00:33:42 -0800 |
commit | d139fdc1d1f10da49f776f84044643c81563d012 (patch) | |
tree | a87eba67467c2ad7cc229baecb42c7189cad3ad9 /mm-video-v4l2/vidc/vdec | |
parent | 4fc4ca4e870f5b9ded7a87a49f14a3f1f6e49b59 (diff) | |
download | android_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.cpp | 7 |
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. |