rtpmpvpay: Don't create empty buffer list

If there's nothing to send, just return
This commit is contained in:
Edward Hervey 2017-11-10 15:51:05 +01:00 committed by Edward Hervey
parent b4edfb5998
commit 50c3733a89

View file

@ -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);
}