From 2143a6e452172d8b84aef5a5764440f263b5bf3b Mon Sep 17 00:00:00 2001 From: Ognyan Tonchev Date: Thu, 20 Mar 2014 15:28:26 +0100 Subject: [PATCH] jpegpay: consider header len when calculating payload len Fixed https://bugzilla.gnome.org/show_bug.cgi?id=726777 --- gst/rtp/gstrtpjpegpay.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/rtp/gstrtpjpegpay.c b/gst/rtp/gstrtpjpegpay.c index 91bd54c5da..227d8ddb8d 100644 --- a/gst/rtp/gstrtpjpegpay.c +++ b/gst/rtp/gstrtpjpegpay.c @@ -813,10 +813,16 @@ gst_rtp_jpeg_pay_handle_buffer (GstRTPBasePayload * basepayload, do { GstBuffer *outbuf; guint8 *payload; - guint payload_size = (bytes_left < mtu ? bytes_left : mtu); + guint payload_size; guint header_size; GstBuffer *paybuf; GstRTPBuffer rtp = { NULL }; + guint rtp_header_size = gst_rtp_buffer_calc_header_len (0); + + /* The available room is the packet MTU, minus the RTP header length. */ + payload_size = + (bytes_left < (mtu - rtp_header_size) ? bytes_left : + (mtu - rtp_header_size)); header_size = sizeof (jpeg_header) + quant_data_size; if (dri_found)