From ceceefd141cd2f398146f50fd6d949be40670711 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 19 Jan 2023 18:49:17 +0200 Subject: [PATCH] appsrc: Don't chain up `BaseSrc::negotiate()` If we have caps then we can only set exactly those caps, if we have no caps yet then negotiating anything is not very meaningful because the caps are defined by the application and not downstream. Avoids, among other things, an unnecessary allocation query and spurious useless caps being set before the first buffer. Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/app/gstappsrc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsrc.c b/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsrc.c index add6a28..913fd40 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsrc.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsrc.c @@ -1329,7 +1329,7 @@ gst_app_src_do_negotiate (GstBaseSrc * basesrc) { GstAppSrc *appsrc = GST_APP_SRC_CAST (basesrc); GstAppSrcPrivate *priv = appsrc->priv; - gboolean result; + gboolean result = TRUE; GstCaps *caps; GST_OBJECT_LOCK (basesrc); @@ -1342,8 +1342,6 @@ gst_app_src_do_negotiate (GstBaseSrc * basesrc) if (caps) { result = gst_base_src_set_caps (basesrc, caps); gst_caps_unref (caps); - } else { - result = GST_BASE_SRC_CLASS (parent_class)->negotiate (basesrc); } g_mutex_lock (&priv->mutex); -- 2.7.4