[FFmpeg-devel] [PATCH] av_find_best_stream

Stefano Sabatini stefano.sabatini-lala
Wed Dec 22 21:54:14 CET 2010


On date Wednesday 2010-12-22 18:45:01 +0100, Nicolas George encoded:
> Le duodi 2 niv?se, an CCXIX, Stefano Sabatini a ?crit?:
> > user is a confusing name, I'd prefer something like user_stream_nb or
> > wanted_stream_nb.
> 
> Ok.
> 
> > not NULL -> non-NULL
> 
> Ok.
> 
> > a bit confusing, I suggest:
> > returns the decoder for the selected stream
> 
> Ok.
> 
> > *codec -> *decoder (or ther other way change the parameter name as it
> > fits you best)
> 
> Fixed.
> 
> > my suggestion:
> > decoder_ptr
> > decoder
> > best_decoder
> 
> I went for decoder_ret, decoder and best_decoder.

Thanks.

[...]
> @@ -2458,6 +2458,42 @@ int av_find_stream_info(AVFormatContext *ic)
>      return ret;
>  }
>  
> +int av_find_best_stream(AVFormatContext *ic,
> +                        enum AVMediaType type,
> +                        int wanted_stream_nb,
> +                        AVCodec **decoder_ret,
> +                        int flags)
> +{
> +    int i, ret = AVERROR_STREAM_NOT_FOUND, stream_number = 0, best_count = -1;
> +    AVCodec *decoder = NULL, *best_decoder = NULL;
> +
> +    for (i = 0; i < ic->nb_streams; i++) {
> +        AVStream *st= ic->streams[i];

nit++: st_=

No more comments from me, wait for Michael review.
-- 
FFmpeg = Fundamentalist and Frightening Moronic Puristic Ecumenical Geisha



More information about the ffmpeg-devel mailing list