diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-06-09 20:49:10 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-06-09 20:49:10 +0200 |
commit | f0e7bd298ce67e14931a225fbd589a3ddd1dd558 (patch) | |
tree | f69dc4854fc011e695b780ad13d6f89a38bf59ab /ext/rtmp | |
parent | bc8f4adaa61a4c8297052e61c5c3be98bacbb665 (diff) | |
download | gstreamer-plugins-bad-f0e7bd298ce67e14931a225fbd589a3ddd1dd558.tar.gz |
rtmpsrc: Fix timestamps after a seek
Diffstat (limited to 'ext/rtmp')
-rw-r--r-- | ext/rtmp/gstrtmpsrc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/rtmp/gstrtmpsrc.c b/ext/rtmp/gstrtmpsrc.c index 3b9df514d..e65532312 100644 --- a/ext/rtmp/gstrtmpsrc.c +++ b/ext/rtmp/gstrtmpsrc.c @@ -307,8 +307,6 @@ gst_rtmp_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer) data = GST_BUFFER_DATA (buf); read = 0; - src->last_timestamp = - MAX (src->last_timestamp, src->rtmp->m_mediaStamp * GST_MSECOND); while (todo > 0) { read = RTMP_Read (src->rtmp, (char *) data, todo); @@ -340,9 +338,12 @@ gst_rtmp_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer) GST_BUFFER_TIMESTAMP (buf) = src->last_timestamp; GST_BUFFER_OFFSET (buf) = src->cur_offset; - src->last_timestamp = - MAX (src->last_timestamp, src->rtmp->m_mediaStamp * GST_MSECOND); src->cur_offset += size; + if (src->last_timestamp == GST_CLOCK_TIME_NONE) + src->last_timestamp = src->rtmp->m_mediaStamp * GST_MSECOND; + else + src->last_timestamp = + MAX (src->last_timestamp, src->rtmp->m_mediaStamp * GST_MSECOND); GST_LOG_OBJECT (src, "Created buffer of size %u at %" G_GINT64_FORMAT " with timestamp %" GST_TIME_FORMAT, size, GST_BUFFER_OFFSET (buf), @@ -490,12 +491,12 @@ gst_rtmp_src_do_seek (GstBaseSrc * basesrc, GstSegment * segment) } src->discont = TRUE; - src->last_timestamp = 0; /* Initial seek */ if (src->cur_offset == 0 && segment->start == 0) return TRUE; + src->last_timestamp = GST_CLOCK_TIME_NONE; if (!RTMP_SendSeek (src->rtmp, segment->start / GST_MSECOND)) { GST_ERROR_OBJECT (src, "Seeking failed"); src->seekable = FALSE; |