Revision 47dec30e libavformat/oggdec.c

View differences:

libavformat/oggdec.c
164 164
    os->bufsize = DECODER_BUFFER_SIZE;
165 165
    os->buf = av_malloc(os->bufsize);
166 166
    os->header = -1;
167
    os->page_begin = 1;
167 168

  
168 169
    st = av_new_stream (s, idx);
169 170
    if (!st)
......
241 242

  
242 243
    idx = ogg_find_stream (ogg, serial);
243 244
    if (idx < 0){
245
        for (i = 0; i < ogg->nstreams; i++) {
246
            if (!ogg->streams[i].page_begin) {
247
                int n;
248

  
249
                for (n = 0; n < ogg->nstreams; n++) {
250
                    av_free(ogg->streams[n].buf);
251
                    av_free(ogg->streams[n].private);
252
                }
253
                ogg->curidx   = -1;
254
                ogg->nstreams = 0;
255
                break;
256
            }
257
        }
244 258
        idx = ogg_new_stream (s, serial);
245 259
        if (idx < 0)
246 260
            return -1;
247 261
    }
248 262

  
249 263
    os = ogg->streams + idx;
264
    if (!(flags & OGG_FLAG_BOS))
265
        os->page_begin = 0;
250 266
    os->page_pos = avio_tell(bc) - 27;
251 267

  
252 268
    if(os->psize > 0)

Also available in: Unified diff