[FFmpeg-devel] [PATCH 275/281] avfilter: convert to new channel layout API

James Almer jamrial at gmail.com
Tue Feb 15 20:52:04 EET 2022



On 2/15/2022 8:50 AM, Anton Khirnov wrote:
> Quoting James Almer (2022-01-13 03:09:07)
>> diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c
>> index ed3c75311a..96704e041c 100644
>> --- a/libavfilter/af_aformat.c
>> +++ b/libavfilter/af_aformat.c
>> @@ -104,9 +104,36 @@ static av_cold int init(AVFilterContext *ctx)
>>                     ff_add_format, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, "sample format");
>>       PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, ff_add_format,
>>                     get_sample_rate, 0, "sample rate");
>> -    PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts,
>> -                  ff_add_channel_layout, av_get_channel_layout, 0,
>> -                  "channel layout");
>> +    {
>> +        AVChannelLayout fmt = { 0 };
>> +        const char *cur = s->channel_layouts_str;
>> +        int ret;
>> +
>> +        if (s->channel_layouts_str && strchr(s->channel_layouts_str, ',')) {
>> +            av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to "
>> +                   "separate channel layout.\n");
> It might be unclear to the user what "this syntax" refers to, maybe make
> it "Using ',' to separate channel layouts is deprecated"

This is copy-paste from the PARSE_FORMATS() macro. I'd rather leave 
changing it to a separate commit, and do it for sample rate and sample 
format too.


More information about the ffmpeg-devel mailing list