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:
parent
36fc2a747a
commit
f641ac60e3
@ -178,12 +178,14 @@ gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay)
|
|||||||
guint frame_count;
|
guint frame_count;
|
||||||
guint payload_length;
|
guint payload_length;
|
||||||
struct rtp_payload *payload;
|
struct rtp_payload *payload;
|
||||||
|
GstFlowReturn res;
|
||||||
|
|
||||||
if (sbcpay->frame_length == 0) {
|
if (sbcpay->frame_length == 0) {
|
||||||
GST_ERROR_OBJECT (sbcpay, "Frame length is 0");
|
GST_ERROR_OBJECT (sbcpay, "Frame length is 0");
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
available = gst_adapter_available (sbcpay->adapter);
|
available = gst_adapter_available (sbcpay->adapter);
|
||||||
|
|
||||||
max_payload =
|
max_payload =
|
||||||
@ -222,7 +224,12 @@ gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay)
|
|||||||
|
|
||||||
sbcpay->last_timestamp += frame_count * sbcpay->frame_duration;
|
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
|
static GstFlowReturn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user