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>
{
GstAppSrc *appsrc = GST_APP_SRC_CAST (basesrc);
GstAppSrcPrivate *priv = appsrc->priv;
- gboolean result;
+ gboolean result = TRUE;
GstCaps *caps;
GST_OBJECT_LOCK (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);