On Wed, Dec 30, 2015 at 09:17:56AM +0100, Paul B Mahol wrote: > Signed-off-by: Paul B Mahol <one...@gmail.com> > --- > libavfilter/trim.c | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/libavfilter/trim.c b/libavfilter/trim.c > index b2d9c6f..9d040dd 100644 > --- a/libavfilter/trim.c > +++ b/libavfilter/trim.c > @@ -345,6 +345,32 @@ drop: > return 0; > } > > +static int atrim_query_formats(AVFilterContext *ctx) > +{ > + AVFilterFormats *formats; > + AVFilterChannelLayouts *layouts; > + int ret; > + > + layouts = ff_all_channel_counts(); > + if (!layouts) > + return AVERROR(ENOMEM); > + ret = ff_set_common_channel_layouts(ctx, layouts); > + if (ret < 0) > + return ret; > + > + formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); > + if (!formats) > + return AVERROR(ENOMEM); > + ret = ff_set_common_formats(ctx, formats); > + if (ret < 0) > + return ret; > + > + formats = ff_all_samplerates(); > + if (!formats) > + return AVERROR(ENOMEM); > + return ff_set_common_samplerates(ctx, formats); > +} > + > #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM > static const AVOption atrim_options[] = { > COMMON_OPTS > @@ -381,6 +407,7 @@ AVFilter ff_af_atrim = { > .name = "atrim", > .description = NULL_IF_CONFIG_SMALL("Pick one continuous section from > the input, drop the rest."), > .init = init, > + .query_formats = atrim_query_formats, > .priv_size = sizeof(TrimContext), > .priv_class = &atrim_class, > .inputs = atrim_inputs,
Mmmh... It seems we have ff_query_formats_all(); can you use that? Q: why is it not the default? -- Clément B.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel