mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-27 15:34:49 +00:00
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
1 changed files with 35 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue