diff options
-rw-r--r-- | audio/gstrtpsbcpay.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/gstrtpsbcpay.c b/audio/gstrtpsbcpay.c index 39cf1970..33640c43 100644 --- a/audio/gstrtpsbcpay.c +++ b/audio/gstrtpsbcpay.c @@ -185,6 +185,8 @@ static GstFlowReturn gst_rtp_sbc_pay_flush_buffers(GstRtpSBCPay *sbcpay) max_payload = MIN(max_payload, available); frame_count = max_payload / sbcpay->frame_length; payload_length = frame_count * sbcpay->frame_length; + if (payload_length == 0) /* Nothing to send */ + return GST_FLOW_OK; outbuf = gst_rtp_buffer_new_allocate(payload_length + RTP_SBC_PAYLOAD_HEADER_SIZE, 0, 0); @@ -219,7 +221,7 @@ static GstFlowReturn gst_rtp_sbc_pay_handle_buffer(GstBaseRTPPayload *payload, sbcpay = GST_RTP_SBC_PAY(payload); sbcpay->timestamp = GST_BUFFER_TIMESTAMP(buffer); - gst_adapter_push(sbcpay->adapter, gst_buffer_copy(buffer)); + gst_adapter_push(sbcpay->adapter, buffer); available = gst_adapter_available(sbcpay->adapter); if (available + RTP_SBC_HEADER_TOTAL >= |