From 50c3733a898e229ef7192adf94561871c174428d Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 10 Nov 2017 15:51:05 +0100 Subject: [PATCH] rtpmpvpay: Don't create empty buffer list If there's nothing to send, just return --- gst/rtp/gstrtpmpvpay.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/rtp/gstrtpmpvpay.c b/gst/rtp/gstrtpmpvpay.c index 4c4de5dbec..eb73af25e8 100644 --- a/gst/rtp/gstrtpmpvpay.c +++ b/gst/rtp/gstrtpmpvpay.c @@ -183,6 +183,10 @@ gst_rtp_mpv_pay_flush (GstRTPMPVPay * rtpmpvpay) ret = GST_FLOW_OK; + GST_DEBUG_OBJECT (rtpmpvpay, "available %u", avail); + if (avail == 0) + return GST_FLOW_OK; + list = gst_buffer_list_new_sized (avail / (GST_RTP_BASE_PAYLOAD_MTU (rtpmpvpay) - RTP_HEADER_LEN) + 1); @@ -231,6 +235,8 @@ gst_rtp_mpv_pay_flush (GstRTPMPVPay * rtpmpvpay) gst_rtp_copy_video_meta (rtpmpvpay, outbuf, paybuf); outbuf = gst_buffer_append (outbuf, paybuf); + GST_DEBUG_OBJECT (rtpmpvpay, "Adding buffer"); + GST_BUFFER_PTS (outbuf) = rtpmpvpay->first_ts; gst_buffer_list_add (list, outbuf); }