From fe26e8d94c82d404d1352427046ea2a9144bd9c0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 19 Sep 2007 16:24:09 +0000 Subject: gst/rtp/gstrtpL16pay.c: Removed some unused code. Original commit message from CVS: * gst/rtp/gstrtpL16pay.c: (gst_rtp_L16_pay_handle_buffer): Removed some unused code. * gst/rtp/gstrtpamrpay.c: (gst_rtp_amr_pay_handle_buffer): * gst/rtp/gstrtpgsmpay.c: (gst_rtp_gsm_pay_handle_buffer): * gst/rtp/gstrtpmp2tpay.c: (gst_rtp_mp2t_pay_handle_buffer): * gst/rtp/gstrtpspeexpay.c: (gst_rtp_speex_pay_handle_buffer): * gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_init_packet), (gst_rtp_theora_pay_flush_packet): * gst/rtp/gstrtpvorbispay.c: (gst_rtp_vorbis_pay_flush_packet): Try to preserve the incomming buffer duration on the outgoing packets. Fixes #478244. --- gst/rtp/gstrtpamrpay.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gst/rtp/gstrtpamrpay.c') diff --git a/gst/rtp/gstrtpamrpay.c b/gst/rtp/gstrtpamrpay.c index e32b11f3..6d781147 100644 --- a/gst/rtp/gstrtpamrpay.c +++ b/gst/rtp/gstrtpamrpay.c @@ -205,7 +205,7 @@ gst_rtp_amr_pay_handle_buffer (GstBaseRTPPayload * basepayload, guint size, payload_len; GstBuffer *outbuf; guint8 *payload, *data, *payload_amr; - GstClockTime timestamp; + GstClockTime timestamp, duration; guint packet_len, mtu; gint i, num_packets, num_nonempty_packets; gint amr_len; @@ -217,6 +217,7 @@ gst_rtp_amr_pay_handle_buffer (GstBaseRTPPayload * basepayload, size = GST_BUFFER_SIZE (buffer); data = GST_BUFFER_DATA (buffer); timestamp = GST_BUFFER_TIMESTAMP (buffer); + duration = GST_BUFFER_DURATION (buffer); /* setup frame size pointer */ if (rtpamrpay->mode == GST_RTP_AMR_P_MODE_NB) @@ -276,6 +277,12 @@ gst_rtp_amr_pay_handle_buffer (GstBaseRTPPayload * basepayload, GST_BUFFER_TIMESTAMP (outbuf) = count * 20 * GST_MSECOND; } + if (duration != GST_CLOCK_TIME_NONE) + GST_BUFFER_DURATION (outbuf) = duration; + else { + GST_BUFFER_DURATION (outbuf) = 20 * GST_MSECOND; + } + /* get payload, this is now writable */ payload = gst_rtp_buffer_get_payload (outbuf); -- cgit