diff --git a/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c b/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c index 948ca35ba7..5e4ae02e31 100644 --- a/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c +++ b/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c @@ -3202,9 +3202,7 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx) if (g_queue_is_empty (&splitmux->pending_input_gops)) { GST_WARNING_OBJECT (pad, "Reference was closed without GOP, dropping"); - GST_SPLITMUX_UNLOCK (splitmux); - GST_PAD_PROBE_INFO_FLOW_RETURN (info) = GST_FLOW_EOS; - return GST_PAD_PROBE_DROP; + goto drop; } check_completed_gop (splitmux, ctx); @@ -3255,6 +3253,12 @@ beach: mq_stream_buf_free (buf_info); GST_PAD_PROBE_INFO_FLOW_RETURN (info) = ret; return GST_PAD_PROBE_PASS; +drop: + GST_SPLITMUX_UNLOCK (splitmux); + if (buf_info) + mq_stream_buf_free (buf_info); + GST_PAD_PROBE_INFO_FLOW_RETURN (info) = GST_FLOW_EOS; + return GST_PAD_PROBE_DROP; } static void