diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index 0f8f7ae852..95766d33e1 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 */