From e135e5baa9a214520315e6a3345d055394135dc9 Mon Sep 17 00:00:00 2001 From: hashworks Date: Sat, 25 May 2024 20:49:52 +0200 Subject: [PATCH] ffmpeg Update: Replace deprecated channel_layout with ch_layout struct --- src/projects/modules/ffmpeg/ffmpeg_conv.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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;