qtmux: fix critical warnings on negotiation error

This pipeline fails to negotiate on my PC:

gst-launch-1.0 v4l2src ! h264parse ! qtmux ! filesink location=t.mp4

When it happens some critical glib warnings are emitted:
-------------------------------
GStreamer-CRITICAL **: 15:09:03.485: gst_mini_object_copy: assertion 'mini_object != NULL' failed

GStreamer-CRITICAL **: 15:09:03.485: gst_mini_object_unref: assertion 'mini_object != NULL' failed

GStreamer-CRITICAL **: 15:09:03.485: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

GStreamer-CRITICAL **: 15:09:03.485: gst_structure_set_value: assertion 'structure != NULL' failed

GStreamer-CRITICAL **: 15:09:03.485: gst_mini_object_unref: assertion 'mini_object != NULL' failed
--------------------------------

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8374>
This commit is contained in:
Alexander Slobodeniuk 2025-01-28 15:08:03 +01:00 committed by GStreamer Marge Bot
parent 41b779e57c
commit 6376849396

View file

@ -2200,6 +2200,9 @@ gst_qt_mux_set_header_on_caps (GstQTMux * mux, GstBuffer * buf)
GstCaps *caps, *tcaps;
tcaps = gst_pad_get_current_caps (GST_AGGREGATOR_SRC_PAD (mux));
if (G_UNLIKELY (tcaps == NULL))
return;
caps = gst_caps_copy (tcaps);
gst_caps_unref (tcaps);