avdevice/avfoundation: convert to new channel layout-API

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2022-11-06 18:29:50 -03:00
parent df968fc1ff
commit 0d0d67ce36

View File

@ -706,8 +706,7 @@ static int get_audio_config(AVFormatContext *s)
stream->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; stream->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
stream->codecpar->sample_rate = basic_desc->mSampleRate; stream->codecpar->sample_rate = basic_desc->mSampleRate;
stream->codecpar->channels = basic_desc->mChannelsPerFrame; av_channel_layout_default(&stream->codecpar->ch_layout, basic_desc->mChannelsPerFrame);
stream->codecpar->channel_layout = av_get_default_channel_layout(stream->codecpar->channels);
ctx->audio_channels = basic_desc->mChannelsPerFrame; ctx->audio_channels = basic_desc->mChannelsPerFrame;
ctx->audio_bits_per_sample = basic_desc->mBitsPerChannel; ctx->audio_bits_per_sample = basic_desc->mBitsPerChannel;