gst_qt_mux_can_renegotiate (GstQTMux * qtmux, GstPad * pad, GstCaps * caps)
{
GstQTMuxPad *qtmuxpad = GST_QT_MUX_PAD_CAST (pad);
+ gboolean ret = TRUE;
/* does not go well to renegotiate stream mid-way, unless
* the old caps are a subset of the new one (this means upstream
* added more info to the caps, as both should be 'fixed' caps) */
+ GST_OBJECT_LOCK (qtmux);
if (!qtmuxpad->configured_caps) {
GST_DEBUG_OBJECT (qtmux, "pad %s accepted caps %" GST_PTR_FORMAT,
GST_PAD_NAME (pad), caps);
- return TRUE;
+ goto out;
}
g_assert (caps != NULL);
GST_WARNING_OBJECT (qtmux,
"pad %s refused renegotiation to %" GST_PTR_FORMAT " from %"
GST_PTR_FORMAT, GST_PAD_NAME (pad), caps, qtmuxpad->configured_caps);
- return FALSE;
+ ret = FALSE;
+ goto out;
}
GST_DEBUG_OBJECT (qtmux,
"pad %s accepted renegotiation to %" GST_PTR_FORMAT " from %"
GST_PTR_FORMAT, GST_PAD_NAME (pad), caps, qtmuxpad->configured_caps);
- return TRUE;
+out:
+ GST_OBJECT_UNLOCK (qtmux);
+
+ return ret;
}
static gboolean
GST_OBJECT_UNLOCK (qtmux);
}
+ GST_OBJECT_LOCK (qtmux);
if (ret)
gst_caps_replace (&qtmux_pad->configured_caps, caps);
+ GST_OBJECT_UNLOCK (qtmux);
gst_event_unref (event);
event = NULL;