bin: Drop need-context messages without source instead of crashing

This commit is contained in:
Sebastian Dröge 2019-09-30 11:34:51 +03:00
parent 35db4a2433
commit 487a3f9a30

View file

@ -4010,6 +4010,8 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
GList *l, *contexts;
gst_message_parse_context_type (message, &context_type);
if (src) {
GST_OBJECT_LOCK (bin);
contexts = GST_ELEMENT_CAST (bin)->contexts;
GST_LOG_OBJECT (bin, "got need-context message type: %s", context_type);
@ -4030,6 +4032,12 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
} else {
gst_message_unref (message);
}
} else {
g_warning
("Got need-context message in bin '%s' without source element, dropping",
GST_ELEMENT_NAME (bin));
gst_message_unref (message);
}
break;
}