lavf/oggdec: simplify destroying streams with chained audio streams.
authorClément Bœsch <ubitux@gmail.com>
Tue, 21 Aug 2012 18:39:14 +0000 (20:39 +0200)
committerClément Bœsch <ubitux@gmail.com>
Sun, 16 Sep 2012 14:52:06 +0000 (16:52 +0200)
nstreams is assumed to be 1 at that point, so the loop is pointless.

libavformat/oggdec.c

index 9d27393..05aeddd 100644 (file)
@@ -256,18 +256,15 @@ static int ogg_read_page(AVFormatContext *s, int *sid)
     idx = ogg_find_stream (ogg, serial);
     if (idx < 0){
         if (ogg->headers) {
-            int n;
 
             if (ogg->nstreams != 1) {
                 av_log_missing_feature(s, "Changing stream parameters in multistream ogg is", 0);
                 return idx;
             }
 
-            for (n = 0; n < ogg->nstreams; n++) {
-                av_freep(&ogg->streams[n].buf);
-                if (!ogg->state || ogg->state->streams[n].private != ogg->streams[n].private)
-                    av_freep(&ogg->streams[n].private);
-            }
+            av_freep(&ogg->streams[0].buf);
+            if (!ogg->state || ogg->state->streams[0].private != ogg->streams[0].private)
+                av_freep(&ogg->streams[0].private);
             ogg->curidx   = -1;
             ogg->nstreams = 0;
             idx = ogg_new_stream(s, serial, 0);