diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-03-15 09:51:42 +0100 |
---|---|---|
committer | Josep Torra <n770galaxy@gmail.com> | 2013-03-15 10:15:06 +0100 |
commit | 519627bbd973441b461002e5b50f8debcb022d40 (patch) | |
tree | b80fef4c5bdab9882279508f879b7e0738f801ee | |
parent | 18dd6457284281c6a5f318bd25662d7253597466 (diff) | |
download | gst-omx-519627bbd973441b461002e5b50f8debcb022d40.tar.gz |
omxvideodec: Don't interpolate timestamps
We will get exactly one frame per input buffer and assigning
timestamps between frames if more than one OMX buffer is required
per frame easily confuses timestamp tracking in OMX.
-rw-r--r-- | omx/gstomxvideodec.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index ba6e083..ac8fd89 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -1454,7 +1454,7 @@ gst_omx_video_dec_handle_frame (GstVideoDecoder * decoder, GstOMXBuffer *buf; GstBuffer *codec_data = NULL; guint offset = 0, size; - GstClockTime timestamp, duration, timestamp_offset = 0; + GstClockTime timestamp, duration; OMX_ERRORTYPE err; self = GST_OMX_VIDEO_DEC (decoder); @@ -1608,22 +1608,20 @@ gst_omx_video_dec_handle_frame (GstVideoDecoder * decoder, GST_BUFFER_DATA (frame->input_buffer) + offset, buf->omx_buf->nFilledLen); - /* Interpolate timestamps if we're passing the buffer - * in multiple chunks */ - if (offset != 0 && duration != GST_CLOCK_TIME_NONE) { - timestamp_offset = gst_util_uint64_scale (offset, duration, size); - } - if (timestamp != GST_CLOCK_TIME_NONE) { buf->omx_buf->nTimeStamp = - gst_util_uint64_scale (timestamp + timestamp_offset, - OMX_TICKS_PER_SECOND, GST_SECOND); - self->last_upstream_ts = timestamp + timestamp_offset; + gst_util_uint64_scale (timestamp, OMX_TICKS_PER_SECOND, GST_SECOND); + self->last_upstream_ts = timestamp; + } else { + buf->omx_buf->nTimeStamp = 0; } - if (duration != GST_CLOCK_TIME_NONE) { + + if (duration != GST_CLOCK_TIME_NONE && offset == 0) { buf->omx_buf->nTickCount = gst_util_uint64_scale (buf->omx_buf->nFilledLen, duration, size); self->last_upstream_ts += duration; + } else { + buf->omx_buf->nTickCount = 0; } if (offset == 0) { |