From 7e46bb80efa4690515e40946f680ec43d67ffd8d Mon Sep 17 00:00:00 2001 From: Burt P Date: Wed, 7 Sep 2016 10:48:03 -0500 Subject: [PATCH] af_hdcd: allow all HDCD sample rates The PM Model Two could output HDCD-encoded audio in CD and all DVD-Audio sample rates. (44100, 48000, 88200, 96000, 176400, and 192000 Hz) Signed-off-by: Burt P --- libavfilter/af_hdcd.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/af_hdcd.c b/libavfilter/af_hdcd.c index c308da1f83..dd9ecc3796 100644 --- a/libavfilter/af_hdcd.c +++ b/libavfilter/af_hdcd.c @@ -1693,9 +1693,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) static int query_formats(AVFilterContext *ctx) { + static const int sample_rates[] = { + 44100, 48000, + 88200, 96000, + 176400, 192000, + -1 + }; AVFilterFormats *in_formats; AVFilterFormats *out_formats; - AVFilterFormats *sample_rates = NULL; AVFilterChannelLayouts *layouts = NULL; AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *outlink = ctx->outputs[0]; @@ -1733,11 +1738,8 @@ static int query_formats(AVFilterContext *ctx) if (ret < 0) return ret; - ret = ff_add_format(&sample_rates, 44100); - if (ret < 0) - return AVERROR(ENOMEM); - - return ff_set_common_samplerates(ctx, sample_rates); + return + ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates) ); } static av_cold void uninit(AVFilterContext *ctx)