Skip to content

Commit

Permalink
ffmpeg Update: Replace deprecated channel_layout with ch_layout struct
Browse files Browse the repository at this point in the history
  • Loading branch information
hashworks committed May 25, 2024
1 parent 776a674 commit e135e5b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/projects/modules/ffmpeg/ffmpeg_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -772,10 +772,15 @@ namespace ffmpeg
break;

case cmn::MediaType::Audio: {
codecpar->ch_layout.nb_channels = static_cast<int>(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<int>(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;

Expand Down

0 comments on commit e135e5b

Please sign in to comment.