rtp: Correct timestamping of buffers when buffer_lists are used

The timestamping of buffers when buffer_lists are used failed if
a buffer did not have both a timestamp and an offset.
This commit is contained in:
Peter Kjellerstedt 2009-10-16 10:50:35 +02:00
parent f1c32d0fbb
commit 7bca2a0019

View file

@ -651,8 +651,8 @@ find_timestamp (GstBuffer ** buffer, guint group, guint idx, HeaderData * data)
data->timestamp = GST_BUFFER_TIMESTAMP (*buffer);
data->offset = GST_BUFFER_OFFSET (*buffer);
/* stop when we find a timestamp and duration */
if (data->timestamp != -1 && data->offset != -1)
/* stop when we find a timestamp */
if (data->timestamp != -1)
return GST_BUFFER_LIST_END;
else
return GST_BUFFER_LIST_CONTINUE;
@ -696,10 +696,11 @@ gst_basertppayload_prepare_push (GstBaseRTPPayload * payload,
data.ssrc = payload->current_ssrc;
data.pt = payload->pt;
data.caps = GST_PAD_CAPS (payload->srcpad);
data.timestamp = -1;
/* find the first buffer with a timestamp */
if (is_list) {
data.timestamp = -1;
data.offset = GST_BUFFER_OFFSET_NONE;
gst_buffer_list_foreach (GST_BUFFER_LIST_CAST (obj),
(GstBufferListFunc) find_timestamp, &data);
} else {