rtpbasepayload: print list size in log output instead of -1
authorAntonio Ospite <antonio.ospite@collabora.com>
Fri, 15 Mar 2019 16:38:58 +0000 (17:38 +0100)
committerAntonio Ospite <antonio.ospite@collabora.com>
Fri, 15 Mar 2019 16:38:58 +0000 (17:38 +0100)
It is weird to see "Preparing to push packet with size 4294967295" in
the logs, so print the list length in case of a buffer list.

gst-libs/gst/rtp/gstrtpbasepayload.c

index 352e862..6f4e222 100644 (file)
@@ -1317,9 +1317,11 @@ gst_rtp_base_payload_prepare_push (GstRTPBasePayload * payload,
   priv->next_seqnum = data.seqnum;
   payload->timestamp = data.rtptime;
 
-  GST_LOG_OBJECT (payload, "Preparing to push packet with size %"
+  GST_LOG_OBJECT (payload, "Preparing to push %s with size %"
       G_GSIZE_FORMAT ", seq=%d, rtptime=%u, pts %" GST_TIME_FORMAT,
-      (is_list) ? -1 : gst_buffer_get_size (GST_BUFFER (obj)),
+      (is_list) ? "list" : "packet",
+      (is_list) ? gst_buffer_list_length (GST_BUFFER_LIST_CAST (obj)) :
+      gst_buffer_get_size (GST_BUFFER (obj)),
       payload->seqnum, data.rtptime, GST_TIME_ARGS (data.pts));
 
   if (g_atomic_int_compare_and_exchange (&payload->priv->