From 0b9976ac467cf6b450dbeb20ed7e5e15d697b2eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 8 Jun 2021 13:05:46 +0300 Subject: [PATCH] appsrc: Correctly check if this is the first buffer that was queued By checking the queue length this would also count events and caps. We already keep track of the number of buffers separately so just use that. Part-of: --- gst-libs/gst/app/gstappsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index 4207192..c7a0a4d 100644 --- a/gst-libs/gst/app/gstappsrc.c +++ b/gst-libs/gst/app/gstappsrc.c @@ -1501,7 +1501,7 @@ gst_app_src_update_queued_push (GstAppSrc * appsrc, GstMiniObject * item) * here. This is especially useful if this was the first buffer because * otherwise we would have to wait until it is actually unqueued to know * the queued duration */ - if (gst_queue_array_get_length (priv->queue) == 1) { + if (priv->queued_buffers == 1) { if (priv->last_segment.stop != -1 && start_buffer_ts > priv->last_segment.stop) start_buffer_ts = priv->last_segment.stop; -- 2.7.4