rtp: Correct timestamping of buffers when buffer_lists are used
authorPeter Kjellerstedt <pkj@axis.com>
Fri, 16 Oct 2009 08:50:35 +0000 (10:50 +0200)
committerPeter Kjellerstedt <pkj@axis.com>
Fri, 16 Oct 2009 08:51:22 +0000 (10:51 +0200)
The timestamping of buffers when buffer_lists are used failed if
a buffer did not have both a timestamp and an offset.

gst-libs/gst/rtp/gstbasertppayload.c

index a3b603c..eaa0f93 100644 (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 {