mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-01 13:49:58 +00:00
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.
This commit is contained in:
parent
6d7242925b
commit
7d7c90bf5c
1 changed files with 10 additions and 6 deletions
|
@ -692,12 +692,16 @@ send_fragment_opened_closed_msg (GstSplitMuxSink * splitmux, gboolean opened)
|
|||
|
||||
g_object_get (splitmux->sink, "location", &location, NULL);
|
||||
|
||||
msg = gst_message_new_element (GST_OBJECT (splitmux),
|
||||
gst_structure_new (msg_name,
|
||||
"location", G_TYPE_STRING, location,
|
||||
"running-time", GST_TYPE_CLOCK_TIME,
|
||||
splitmux->reference_ctx->out_running_time, NULL));
|
||||
gst_element_post_message (GST_ELEMENT_CAST (splitmux), msg);
|
||||
/* 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),
|
||||
gst_structure_new (msg_name,
|
||||
"location", G_TYPE_STRING, location,
|
||||
"running-time", GST_TYPE_CLOCK_TIME,
|
||||
splitmux->reference_ctx->out_running_time, NULL));
|
||||
gst_element_post_message (GST_ELEMENT_CAST (splitmux), msg);
|
||||
}
|
||||
|
||||
g_free (location);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue