Commit 2cf2bc45 authored by Vivia Nikolaidou's avatar Vivia Nikolaidou 🦆 Committed by Tim-Philipp Müller

splitmuxsink: Don't send fragment-opened-closed message if the reference ctx is NULL

It can happen during teardown that the reference context becomes NULL.
In that case, trying to send the fragment-opened-closed message would
lead to a crash.
parent 170f0c95
...@@ -673,12 +673,16 @@ send_fragment_opened_closed_msg (GstSplitMuxSink * splitmux, gboolean opened) ...@@ -673,12 +673,16 @@ send_fragment_opened_closed_msg (GstSplitMuxSink * splitmux, gboolean opened)
g_object_get (splitmux->sink, "location", &location, NULL); g_object_get (splitmux->sink, "location", &location, NULL);
/* If it's in the middle of a teardown, the reference_ctc might have become
* NULL */
if (splitmux->reference_ctx) {
msg = gst_message_new_element (GST_OBJECT (splitmux), msg = gst_message_new_element (GST_OBJECT (splitmux),
gst_structure_new (msg_name, gst_structure_new (msg_name,
"location", G_TYPE_STRING, location, "location", G_TYPE_STRING, location,
"running-time", GST_TYPE_CLOCK_TIME, "running-time", GST_TYPE_CLOCK_TIME,
splitmux->reference_ctx->out_running_time, NULL)); splitmux->reference_ctx->out_running_time, NULL));
gst_element_post_message (GST_ELEMENT_CAST (splitmux), msg); gst_element_post_message (GST_ELEMENT_CAST (splitmux), msg);
g_free (location); g_free (location);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment