qtdemux: turn impossible condition into an assert
authorAlicia Boya García <aboya@igalia.com>
Sat, 22 Sep 2018 15:22:46 +0000 (17:22 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 24 Sep 2018 07:33:02 +0000 (08:33 +0100)
qtdemux_update_streams() is only ever called after checking
`qtdemux->streams_aware` is TRUE. There is no need to check for that
condition again.

`qtdemux->streams_aware` is only modified when the demuxer is
hard-resetted, which is mutually exclusive with demuxing, so it cannot
be modified during the call.

https://bugzilla.gnome.org/show_bug.cgi?id=797191

gst/isomp4/qtdemux.c

index d6b4cd4..e77eacb 100644 (file)
@@ -12425,6 +12425,7 @@ static gboolean
 qtdemux_update_streams (GstQTDemux * qtdemux)
 {
   GList *iter, *next;
+  g_assert (qtdemux->streams_aware);
 
   /* At below, figure out which stream in active_streams has identical stream-id
    * with that of in old_streams. If there is matching stream-id,
@@ -12449,8 +12450,7 @@ qtdemux_update_streams (GstQTDemux * qtdemux)
 
     qtdemux->n_streams++;
 
-    if (qtdemux->streams_aware
-        && (tmp = _stream_in_list (qtdemux->old_streams, stream)) != NULL
+    if ((tmp = _stream_in_list (qtdemux->old_streams, stream)) != NULL
         && QTDEMUX_STREAM (tmp->data)->pad) {
       QtDemuxStream *oldstream = QTDEMUX_STREAM (tmp->data);