From 435c340d158c872cc18db9ad1f23f049c6f82c2c Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 28 Mar 2012 16:45:03 +0200 Subject: [PATCH] appsink: optionally obtain current caps from negotiated pad caps --- gst-libs/gst/app/gstappsink.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst-libs/gst/app/gstappsink.c b/gst-libs/gst/app/gstappsink.c index 25c95ebf08..27b7a0684e 100644 --- a/gst-libs/gst/app/gstappsink.c +++ b/gst-libs/gst/app/gstappsink.c @@ -697,6 +697,15 @@ restart: if (priv->flushing) goto flushing; + /* queue holding caps event might have been FLUSHed, + * but caps state still present in pad caps */ + if (G_UNLIKELY (!priv->last_caps && + gst_pad_has_current_caps (GST_BASE_SINK_PAD (psink)))) { + priv->last_caps = gst_pad_get_current_caps (GST_BASE_SINK_PAD (psink)); + GST_DEBUG_OBJECT (appsink, "activating pad caps %" GST_PTR_FORMAT, + priv->last_caps); + } + GST_DEBUG_OBJECT (appsink, "pushing render buffer %p on queue (%d)", buffer, priv->num_buffers);