From ed6e7776f3b82e9db2d1cdde1999118c9fbdb7a8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 6 Feb 2013 10:07:47 +0100 Subject: [PATCH] appsrc: negotiate before popping buffer First negotiate and then try to pop a buffer from the queue. This is just to improve the debug log. --- gst-libs/gst/app/gstappsrc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index 0f8f7ae..95766d3 100644 --- a/gst-libs/gst/app/gstappsrc.c +++ b/gst-libs/gst/app/gstappsrc.c @@ -1008,15 +1008,16 @@ gst_app_src_create (GstBaseSrc * bsrc, guint64 offset, guint size, if (!g_queue_is_empty (priv->queue)) { guint buf_size; - *buf = g_queue_pop_head (priv->queue); - buf_size = gst_buffer_get_size (*buf); - - GST_DEBUG_OBJECT (appsrc, "we have buffer %p of size %u", *buf, buf_size); if (priv->new_caps) { gst_app_src_do_negotiate (bsrc); priv->new_caps = FALSE; } + *buf = g_queue_pop_head (priv->queue); + buf_size = gst_buffer_get_size (*buf); + + GST_DEBUG_OBJECT (appsrc, "we have buffer %p of size %u", *buf, buf_size); + priv->queued_bytes -= buf_size; /* only update the offset when in random_access mode */ -- 2.7.4