mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
rtmpsrc: Improve timestamp handling a bit
This commit is contained in:
parent
827ecadb81
commit
d0ce1ff675
1 changed files with 6 additions and 3 deletions
|
@ -335,6 +335,8 @@ gst_rtmp_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer)
|
||||||
data = GST_BUFFER_DATA (buf);
|
data = GST_BUFFER_DATA (buf);
|
||||||
read = 0;
|
read = 0;
|
||||||
|
|
||||||
|
src->last_timestamp =
|
||||||
|
MAX (src->last_timestamp, src->rtmp->m_mediaStamp * GST_MSECOND);
|
||||||
while (todo > 0) {
|
while (todo > 0) {
|
||||||
read = RTMP_Read (src->rtmp, (char *) data, todo);
|
read = RTMP_Read (src->rtmp, (char *) data, todo);
|
||||||
|
|
||||||
|
@ -363,15 +365,16 @@ gst_rtmp_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer)
|
||||||
src->discont = FALSE;
|
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_TIMESTAMP (buf) = src->last_timestamp;
|
||||||
GST_BUFFER_OFFSET (buf) = src->cur_offset;
|
GST_BUFFER_OFFSET (buf) = src->cur_offset;
|
||||||
|
|
||||||
|
src->last_timestamp =
|
||||||
|
MAX (src->last_timestamp, src->rtmp->m_mediaStamp * GST_MSECOND);
|
||||||
src->cur_offset += size;
|
src->cur_offset += size;
|
||||||
|
|
||||||
GST_LOG_OBJECT (src, "Created buffer of size %u at %" G_GINT64_FORMAT
|
GST_LOG_OBJECT (src, "Created buffer of size %u at %" G_GINT64_FORMAT
|
||||||
" with timestamp %" GST_TIME_FORMAT, size, GST_BUFFER_OFFSET (buf),
|
" 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 */
|
/* we're done, return the buffer */
|
||||||
|
|
Loading…
Reference in a new issue