ffserver: Replace two loops with one loop.
authorMike Williams <mike@mikebwilliams.com>
Wed, 13 Jul 2011 18:24:47 +0000 (14:24 -0400)
committerRonald S. Bultje <rsbultje@gmail.com>
Thu, 14 Jul 2011 21:00:07 +0000 (14:00 -0700)
Signed-off-by: Mike Williams <mike@mikebwilliams.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
ffserver.c

index ca4b54f..2cbfe75 100644 (file)
@@ -3648,21 +3648,13 @@ static void build_feed_streams(void)
     for(stream = first_stream; stream != NULL; stream = stream->next) {
         feed = stream->feed;
         if (feed) {
-            if (!stream->is_feed) {
-                /* we handle a stream coming from a feed */
-                for(i=0;i<stream->nb_streams;i++)
-                    stream->feed_streams[i] = add_av_stream(feed, stream->streams[i]);
-            }
-        }
-    }
-
-    /* gather all streams */
-    for(stream = first_stream; stream != NULL; stream = stream->next) {
-        feed = stream->feed;
-        if (feed) {
             if (stream->is_feed) {
                 for(i=0;i<stream->nb_streams;i++)
                     stream->feed_streams[i] = i;
+            } else {
+                /* we handle a stream coming from a feed */
+                for(i=0;i<stream->nb_streams;i++)
+                    stream->feed_streams[i] = add_av_stream(feed, stream->streams[i]);
             }
         }
     }