rtpsbcpay: Fix use of gstreamer plugin with rhythmbox and banshee and rtp timestamps.
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>
Wed, 23 Jan 2008 19:17:33 +0000 (19:17 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 10 Jan 2013 00:13:14 +0000 (00:13 +0000)
gst/rtp/gstrtpsbcpay.c
gst/rtp/gstrtpsbcpay.h

index 2d6d705..befeb50 100644 (file)
@@ -195,7 +195,7 @@ gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay)
   memcpy (payload_data + RTP_SBC_PAYLOAD_HEADER_SIZE, data, max_payload);
   g_free (data);
 
-  /* FIXME - timestamp it! */
+  GST_BUFFER_TIMESTAMP (outbuf) = sbcpay->timestamp;
   GST_DEBUG_OBJECT (sbcpay, "Pushing %d bytes", max_payload);
 
   return gst_basertppayload_push (GST_BASE_RTP_PAYLOAD (sbcpay), outbuf);
@@ -210,6 +210,7 @@ gst_rtp_sbc_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer)
   sbcpay = GST_RTP_SBC_PAY (payload);
   gst_adapter_push (sbcpay->adapter, gst_buffer_copy (buffer));
 
+  sbcpay->timestamp = GST_BUFFER_TIMESTAMP (buffer);
   available = gst_adapter_available (sbcpay->adapter);
   if (available + RTP_SBC_HEADER_TOTAL >=
       GST_BASE_RTP_PAYLOAD_MTU (sbcpay) ||
@@ -332,6 +333,7 @@ gst_rtp_sbc_pay_init (GstRtpSBCPay * self, GstRtpSBCPayClass * klass)
 {
   self->adapter = gst_adapter_new ();
   self->frame_length = 0;
+  self->timestamp = 0;
 
   self->min_frames = DEFAULT_MIN_FRAMES;
 }
index f086a1c..474d720 100644 (file)
@@ -48,6 +48,7 @@ struct _GstRtpSBCPay {
        GstBaseRTPPayload base;
 
        GstAdapter *adapter;
+       GstClockTime timestamp;
 
        guint frame_length;