On Tue, 29 Apr 2014 15:45:29 +0200, Alessandro Ghedini <[email protected]> 
wrote:
> On lun, apr 28, 2014 at 08:01:11 +0200, Anton Khirnov wrote:
> > 
> > Hi,
> > Nice patch. I've been considering stealing it from mplayer for some time, 
> > thanks
> > for beating me to it.
> > 
> > My comments are mostly details, feel free to ignore the ones prefixed with 
> > nit:
> > 
> > On Sun, 27 Apr 2014 15:37:03 +0200, Alessandro Ghedini 
> > <[email protected]> wrote:
> > > +static int query_formats(AVFilterContext *ctx)
> > > +{
> > > +    AVFilterFormats *formats = NULL;
> > > +    AVFilterChannelLayouts *layouts;
> > > +
> > > +    static const enum AVSampleFormat sample_fmts[] = {
> > > +        AV_SAMPLE_FMT_U8,
> > > +        AV_SAMPLE_FMT_S16,
> > > +        AV_SAMPLE_FMT_S32,
> > > +        AV_SAMPLE_FMT_FLT,
> > > +        AV_SAMPLE_FMT_DBL,
> > > +        AV_SAMPLE_FMT_NONE,
> > > +    };
> > > +
> > > +    layouts = ff_all_channel_layouts();
> > > +    ff_add_channel_layout(&layouts, av_get_default_channel_layout(2));
> > 
> > Why is this line here?
> 
> Well, my intention was to limit the filter to only stereo streams, but maybe
> it's the wrong way to do it (or maybe it shouldn't be done in the first 
> place?).
> 

Right, I wasn't thinking. I suppose this cannot work with anything other than
stereo by design.

The proper way to do this, is
layouts = NULL;
ff_add_channel_layout(layouts, AV_CH_LAYOUT_STEREO);

And you should properly check the return code from ff_add_channel_layout.


-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to