mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 09:12:19 +00:00
query: Add an empty structure in writable_structure() if there is none yet
This is consistent with how it works for GstEvent already.
This commit is contained in:
parent
62ebee096b
commit
c813b1c276
1 changed files with 12 additions and 1 deletions
|
@ -731,10 +731,21 @@ gst_query_get_structure (GstQuery * query)
|
||||||
GstStructure *
|
GstStructure *
|
||||||
gst_query_writable_structure (GstQuery * query)
|
gst_query_writable_structure (GstQuery * query)
|
||||||
{
|
{
|
||||||
|
GstStructure *structure;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_QUERY (query), NULL);
|
g_return_val_if_fail (GST_IS_QUERY (query), NULL);
|
||||||
g_return_val_if_fail (gst_query_is_writable (query), NULL);
|
g_return_val_if_fail (gst_query_is_writable (query), NULL);
|
||||||
|
|
||||||
return GST_QUERY_STRUCTURE (query);
|
structure = GST_QUERY_STRUCTURE (query);
|
||||||
|
|
||||||
|
if (structure == NULL) {
|
||||||
|
structure =
|
||||||
|
gst_structure_new_id_empty (gst_query_type_to_quark (GST_QUERY_TYPE
|
||||||
|
(query)));
|
||||||
|
gst_structure_set_parent_refcount (structure, &query->mini_object.refcount);
|
||||||
|
GST_QUERY_STRUCTURE (query) = structure;
|
||||||
|
}
|
||||||
|
return structure;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue