rtpsbcpay: fix if buffer size exceeds MTU

The plugin queued buffer data if not all buffer data fit
into a single RTP packet. Now RTP packets are pushed as long
as enough data is available.
This commit is contained in:
Jochen Henneberg 2017-08-14 10:36:56 +00:00 committed by Arun Raghavan
parent 36fc2a747a
commit f641ac60e3

View file

@ -178,12 +178,14 @@ gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay)
guint frame_count;
guint payload_length;
struct rtp_payload *payload;
GstFlowReturn res;
if (sbcpay->frame_length == 0) {
GST_ERROR_OBJECT (sbcpay, "Frame length is 0");
return GST_FLOW_ERROR;
}
do {
available = gst_adapter_available (sbcpay->adapter);
max_payload =
@ -222,7 +224,12 @@ gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay)
sbcpay->last_timestamp += frame_count * sbcpay->frame_duration;
return gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (sbcpay), outbuf);
res = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (sbcpay), outbuf);
/* try to send another RTP buffer if available data exceeds MTU size */
} while (res == GST_FLOW_OK)
return res;
}
static GstFlowReturn