diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h index 8252f8e48..c08cb65ea 100644 --- a/src/projects/modules/ffmpeg/ffmpeg_conv.h +++ b/src/projects/modules/ffmpeg/ffmpeg_conv.h @@ -772,10 +772,15 @@ namespace ffmpeg break; case cmn::MediaType::Audio: { - codecpar->ch_layout.nb_channels = static_cast(media_track->GetChannel().GetCounts()); - codecpar->channel_layout = ToAVChannelLayout(media_track->GetChannel().GetLayout()); - codecpar->sample_rate = media_track->GetSample().GetRateNum(); - codecpar->frame_size = (media_track->GetAudioSamplesPerFrame()!=0)?media_track->GetAudioSamplesPerFrame():1024; + uint64_t channel_layout = ToAVChannelLayout(media_track->GetChannel().GetLayout()); + codecpar->ch_layout = { + .order = AVChannelOrder::AV_CHANNEL_ORDER_UNSPEC, + .nb_channels = static_cast(media_track->GetChannel().GetCounts()), + .u = {.mask = channel_layout} + }; + + codecpar->sample_rate = media_track->GetSample().GetRateNum(); + codecpar->frame_size = (media_track->GetAudioSamplesPerFrame()!=0)?media_track->GetAudioSamplesPerFrame():1024; } break;