rtpbasepayload: print list size in log output instead of -1

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.
This commit is contained in:
Antonio Ospite 2019-03-15 17:38:58 +01:00
parent f672277509
commit 1eb9c5b309

View file

@ -1317,9 +1317,11 @@ gst_rtp_base_payload_prepare_push (GstRTPBasePayload * payload,
priv->next_seqnum = data.seqnum; priv->next_seqnum = data.seqnum;
payload->timestamp = data.rtptime; 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, 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)); payload->seqnum, data.rtptime, GST_TIME_ARGS (data.pts));
if (g_atomic_int_compare_and_exchange (&payload->priv-> if (g_atomic_int_compare_and_exchange (&payload->priv->