Commit edca8038 authored by Clément Bœsch's avatar Clément Bœsch

lavf/oggdec: simplify destroying streams with chained audio streams.

nstreams is assumed to be 1 at that point, so the loop is pointless.
parent 277ddf12
...@@ -256,18 +256,15 @@ static int ogg_read_page(AVFormatContext *s, int *sid) ...@@ -256,18 +256,15 @@ static int ogg_read_page(AVFormatContext *s, int *sid)
idx = ogg_find_stream (ogg, serial); idx = ogg_find_stream (ogg, serial);
if (idx < 0){ if (idx < 0){
if (ogg->headers) { if (ogg->headers) {
int n;
if (ogg->nstreams != 1) { if (ogg->nstreams != 1) {
av_log_missing_feature(s, "Changing stream parameters in multistream ogg is", 0); av_log_missing_feature(s, "Changing stream parameters in multistream ogg is", 0);
return idx; return idx;
} }
for (n = 0; n < ogg->nstreams; n++) { av_freep(&ogg->streams[0].buf);
av_freep(&ogg->streams[n].buf); if (!ogg->state || ogg->state->streams[0].private != ogg->streams[0].private)
if (!ogg->state || ogg->state->streams[n].private != ogg->streams[n].private) av_freep(&ogg->streams[0].private);
av_freep(&ogg->streams[n].private);
}
ogg->curidx = -1; ogg->curidx = -1;
ogg->nstreams = 0; ogg->nstreams = 0;
idx = ogg_new_stream(s, serial, 0); idx = ogg_new_stream(s, serial, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment