From c414f9560a0909733440d37d0d3c8cf317c7272a Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 29 Oct 2021 03:46:25 +0200 Subject: [PATCH] rtptwcc: don't assume all PacketInfo->data are buffers They can also be buffer lists Part-of: --- .../gst-plugins-good/gst/rtpmanager/rtptwcc.c | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/rtptwcc.c b/subprojects/gst-plugins-good/gst/rtpmanager/rtptwcc.c index 691428c..f843465 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/rtptwcc.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/rtptwcc.c @@ -272,10 +272,27 @@ static guint16 rtp_twcc_manager_set_send_twcc_seqnum (RTPTWCCManager * twcc, RTPPacketInfo * pinfo) { - guint16 seqnum = twcc->send_seqnum++; - pinfo->data = gst_buffer_make_writable (pinfo->data); - _set_twcc_seqnum_data (pinfo->data, twcc->send_ext_id, seqnum); - return seqnum; + guint16 first_seqnum = twcc->send_seqnum; + + if (GST_IS_BUFFER_LIST (pinfo->data)) { + GstBufferList *list; + guint i = 0; + + pinfo->data = gst_buffer_list_make_writable (pinfo->data); + + list = GST_BUFFER_LIST (pinfo->data); + + for (i = 0; i < gst_buffer_list_length (list); i++) { + GstBuffer *buffer = gst_buffer_list_get_writable (list, i); + + _set_twcc_seqnum_data (buffer, twcc->send_ext_id, twcc->send_seqnum++); + } + } else { + pinfo->data = gst_buffer_make_writable (pinfo->data); + _set_twcc_seqnum_data (pinfo->data, twcc->send_ext_id, twcc->send_seqnum++); + } + + return first_seqnum; } static gint32 -- 2.7.4