diff options
author | Edward Hervey <edward@centricular.com> | 2017-10-27 09:53:06 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-10-27 09:53:06 +0200 |
commit | c0c9a531efd3e40068037b7d8109ec8fbe6553a6 (patch) | |
tree | 5c7cda247fbf9c56cf18d09957700be000768ea1 /gst | |
parent | 4844adf193b8ea4d289898f0a0019daad47731c1 (diff) |
event: Don't allow invalid SELECT_STREAMS event creation
Asking to select no streams makes no sense and can create various
issues.
If one doesn't one any stream it should deactivate (or not use) the
element in question.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gstevent.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/gstevent.c b/gst/gstevent.c index 815898f59..207388acc 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -593,7 +593,10 @@ gst_event_parse_flush_stop (GstEvent * event, gboolean * reset_time) * in #GST_EVENT_STREAM_START, #GST_EVENT_STREAM_COLLECTION or * #GST_MESSSAGE_STREAM_COLLECTION. * - * Returns: (transfer full): a new select-streams event. + * Note: The list of @streams can not be empty. + * + * Returns: (transfer full): a new select-streams event or %NULL in case of + * an error (like an empty streams list). * * Since: 1.10 */ @@ -605,6 +608,8 @@ gst_event_new_select_streams (GList * streams) GstStructure *struc; GList *tmpl; + g_return_val_if_fail (streams != NULL, NULL); + GST_CAT_INFO (GST_CAT_EVENT, "Creating new select-streams event"); struc = gst_structure_new_id_empty (GST_QUARK (EVENT_SELECT_STREAMS)); g_value_init (&val, GST_TYPE_LIST); |