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

James Almer jamrial at gmail.com
Fri Feb 18 15:07:16 EET 2022



On 2/16/2022 3:15 PM, Anton Khirnov wrote:
>> diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
>> index b89a680883..3ebd279df7 100644
>> --- a/libavfilter/src_movie.c
>> +++ b/libavfilter/src_movie.c
>> @@ -189,23 +189,24 @@ static int guess_channel_layout(MovieStream *st, int st_index, void *log_ctx)
>>   {
>>       AVCodecParameters *dec_par = st->st->codecpar;
>>       char buf[256];
>> -    int64_t chl = av_get_default_channel_layout(dec_par->channels);
>> +    AVChannelLayout chl = { 0 };
>>   
>> -    if (!chl) {
>> +    av_channel_layout_default(&chl, dec_par->ch_layout.nb_channels);
>> +
>> +    if (!KNOWN(&chl)) {
>>           av_log(log_ctx, AV_LOG_ERROR,
>>                  "Channel layout is not set in stream %d, and could not "
>>                  "be guessed from the number of channels (%d)\n",
>> -               st_index, dec_par->channels);
>> +               st_index, dec_par->ch_layout.nb_channels);
>>           return AVERROR(EINVAL);
> Should this still be an error? Unspec layouts should now be properly
> supported by (almost?) everything.

Probably, but making it no longer abort if a native channel layout can't 
be guessed is a behavior change that I'd rather leave for a different 
patch, if you don't mind.

> 
> -- Anton Khirnov _______________________________________________ 
> ffmpeg-devel mailing list ffmpeg-devel at ffmpeg.org 
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit 
> link above, or email ffmpeg-devel-request at ffmpeg.org with subject 
> "unsubscribe".


More information about the ffmpeg-devel mailing list