rtmpsrc: Improve timestamp handling a bit

This commit is contained in:
Sebastian Dröge 2010-06-06 15:29:34 +02:00
parent 827ecadb81
commit d0ce1ff675

View file

@ -335,6 +335,8 @@ 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);
@ -363,15 +365,16 @@ gst_rtmp_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer)
src->discont = FALSE;
}
src->last_timestamp =
MAX (src->last_timestamp, src->rtmp->m_mediaStamp * GST_MSECOND);
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;
GST_LOG_OBJECT (src, "Created buffer of size %u at %" G_GINT64_FORMAT
" with timestamp %" GST_TIME_FORMAT, size, GST_BUFFER_OFFSET (buf),
GST_TIME_ARGS (src->last_timestamp));
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
/* we're done, return the buffer */