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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4020>
This commit is contained in:
Sebastian Dröge 2023-01-19 18:49:17 +02:00 committed by GStreamer Marge Bot
parent 90508b7387
commit ceceefd141

View file

@ -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);