From d851b8a8b48620c282b0d22f3622f2941ab80dfb Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 29 Aug 2013 13:15:15 +0200 Subject: [PATCH] rtpmpvpay: Fix RTP buffer allocation in rtpmpvpay RTP buffer allocation should not be done with padding for the specific MPEG2 header as the padding is done at the end of the buffer and the last byte is the size of the padding. https://bugzilla.gnome.org/show_bug.cgi?id=706970 --- gst/rtp/gstrtpmpvpay.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/rtp/gstrtpmpvpay.c b/gst/rtp/gstrtpmpvpay.c index 87c511d..0751bcd 100644 --- a/gst/rtp/gstrtpmpvpay.c +++ b/gst/rtp/gstrtpmpvpay.c @@ -180,14 +180,16 @@ gst_rtp_mpv_pay_flush (GstRTPMPVPay * rtpmpvpay) GstRTPBuffer rtp = { NULL }; GstBuffer *paybuf; - packet_len = gst_rtp_buffer_calc_packet_len (avail, 4, 0); + packet_len = gst_rtp_buffer_calc_packet_len (avail + 4, 0, 0); towrite = MIN (packet_len, GST_RTP_BASE_PAYLOAD_MTU (rtpmpvpay)); - payload_len = gst_rtp_buffer_calc_payload_len (towrite, 4, 0); + payload_len = gst_rtp_buffer_calc_payload_len (towrite, 0, 0); outbuf = gst_rtp_buffer_new_allocate (4, 0, 0); + payload_len -= 4; + gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); payload = gst_rtp_buffer_get_payload (&rtp); -- 2.7.4