From 637684939673c8cad2b157df64792b31a5b08a23 Mon Sep 17 00:00:00 2001 From: Alexander Slobodeniuk Date: Tue, 28 Jan 2025 15:08:03 +0100 Subject: [PATCH] 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: --- subprojects/gst-plugins-good/gst/isomp4/gstqtmux.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/isomp4/gstqtmux.c b/subprojects/gst-plugins-good/gst/isomp4/gstqtmux.c index 69589cfc9a..a233e06282 100644 --- a/subprojects/gst-plugins-good/gst/isomp4/gstqtmux.c +++ b/subprojects/gst-plugins-good/gst/isomp4/gstqtmux.c @@ -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);