[FFmpeg-devel] BFI Demuxer

Sisir Koppaka sisir.koppaka
Fri Apr 11 20:53:12 CEST 2008


Thanks, Vitor!

All the remaining suggestions above were implemented. A summary:


>>+    /* Setting up the audio codec now... */
>> +    astream = av_new_stream(s, 0);      /* shouldn't 0 be 1 here */
>> +    if (!astream)
>> +        return AVERROR(ENOMEM);

>> +    bfi->audio_index = astream->index;

>unneeded

Fixed. All index variables removed ... 0, 1 are directly used as indices
now.

  >> +        url_fseek(pb, -1, SEEK_CUR);
  >breaks unseekable input

Fixed. No more seeking backwards. The infinite loop was also replaced...

> About the casts, did you mean that they were not necessary or that the
> type
> > wasn't right?
>
> not necessary
>

Fixed.


>
>
> [...]
>
> > >
> > >
> > > [...]
> > > > +        while (get_byte(pb) != 'I') {
> > > > +            continue;
> > > > +        }
> > >
> > > infinite loop
> > >
> > But that is the intent, right? Usually, the loop proceeds only two,
> three
> > times, I think, before finally stopping. I'll put a av_log there and if
> it's
> > not too many times, then is it ok to have it?
>
> Think of a damaged file with no 'I'
>

Fixed, resulting in a more resilient demuxer... :)


>
>
> [...]
> > >
> > >
> > > [...]
> > >
> > > > +static int bfi_read_close(AVFormatContext * s)
> > > > +{
> > > > +    BFIContext *bfi = s->priv_data;
> > > > +    av_free(s->streams[bfi->video_index]->codec->extradata);
> > >
> > > this is wrong
> > >
> >
> > Should we free extradata in the decoder close function in that case?
>
> see av_close_input_stream()
>

Fixed.


-----------------
Sisir Koppaka




More information about the ffmpeg-devel mailing list