diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-03-14 17:36:32 +0400 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-03-14 21:43:53 +0400 |
commit | 9ace0dbe41c67e08291d705a8ec4b0ecbf209783 (patch) | |
tree | 42ad05267f708361c66bc2b515dcde649a2c7e4b /libavfilter | |
parent | 870e625108dd412fb89ed8ac36b8fdb66a671fcd (diff) |
lavfi/ebur128: use same ref for inputs and outputs.
Fixes Ticket2342.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/f_ebur128.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index 05ea63033f..6431dfab84 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -665,22 +665,6 @@ static int query_formats(AVFilterContext *ctx) static const int input_srate[] = {48000, -1}; // ITU-R BS.1770 provides coeff only for 48kHz static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }; - /* set input audio formats */ - formats = ff_make_format_list(sample_fmts); - if (!formats) - return AVERROR(ENOMEM); - ff_formats_ref(formats, &inlink->out_formats); - - layouts = ff_all_channel_layouts(); - if (!layouts) - return AVERROR(ENOMEM); - ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts); - - formats = ff_make_format_list(input_srate); - if (!formats) - return AVERROR(ENOMEM); - ff_formats_ref(formats, &inlink->out_samplerates); - /* set optional output video format */ if (ebur128->do_video) { formats = ff_make_format_list(pix_fmts); @@ -690,20 +674,25 @@ static int query_formats(AVFilterContext *ctx) outlink = ctx->outputs[1]; } - /* set audio output formats (same as input since it's just a passthrough) */ + /* set input and output audio formats + * Note: ff_set_common_* functions are not used because they affect all the + * links, and thus break the video format negociation */ formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); + ff_formats_ref(formats, &inlink->out_formats); ff_formats_ref(formats, &outlink->in_formats); layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); + ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts); ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts); formats = ff_make_format_list(input_srate); if (!formats) return AVERROR(ENOMEM); + ff_formats_ref(formats, &inlink->out_samplerates); ff_formats_ref(formats, &outlink->in_samplerates); return 0; |