[FFmpeg-devel] [PATCH 1/3] avformat/slndec: add support to set channel layout

James Almer jamrial at gmail.com
Sun Mar 20 19:06:32 EET 2022



On 3/19/2022 10:52 AM, Anton Khirnov wrote:
> Quoting James Almer (2022-03-18 23:19:05)
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>   libavformat/pcmdec.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
>> index dcd13787d5..a2bcfc2814 100644
>> --- a/libavformat/pcmdec.c
>> +++ b/libavformat/pcmdec.c
>> @@ -170,7 +170,8 @@ PCMDEF(vidc,  "PCM Archimedes VIDC",                            NULL,  VIDC)
>>   #if CONFIG_SLN_DEMUXER
>>   static const AVOption sln_options[] = {
>>       { "sample_rate", "", offsetof(PCMAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 8000}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
>> -    { "channels",    "", offsetof(PCMAudioDemuxerContext, channels),    AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
>> +    { "channels",    "", offsetof(PCMAudioDemuxerContext, channels),    AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
>> +    { "ch_layout",   "", offsetof(PCMAudioDemuxerContext, ch_layout),   AV_OPT_TYPE_CHLAYOUT, {.str = "mono"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
>>       { NULL },
>>   };
>>   
>> -- 
>> 2.35.1
> 
> For what purpose? The demuxer doesn't do anything with the value.

The demuxer calls pcm_read_header() as init, which uses it.


More information about the ffmpeg-devel mailing list