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
This commit is contained in:
Wim Taymans 2013-08-29 13:15:15 +02:00
parent f7528d274b
commit d851b8a8b4

View file

@ -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);