query: Don't assert if no context is set in the query

This commit is contained in:
Sebastian Dröge 2013-07-16 16:24:38 +02:00
parent 2fbd6dcf24
commit 3821cee574

View file

@ -2495,13 +2495,17 @@ void
gst_query_parse_context (GstQuery * query, GstContext ** context) gst_query_parse_context (GstQuery * query, GstContext ** context)
{ {
GstStructure *structure; GstStructure *structure;
const GValue *v;
g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT); g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT);
g_return_if_fail (context != NULL); g_return_if_fail (context != NULL);
structure = GST_QUERY_STRUCTURE (query); structure = GST_QUERY_STRUCTURE (query);
*context = g_value_get_boxed (gst_structure_id_get_value (structure, v = gst_structure_id_get_value (structure, GST_QUARK (CONTEXT));
GST_QUARK (CONTEXT))); if (v)
*context = g_value_get_boxed (v);
else
*context = NULL;
} }
static void static void