[xcode] Use ffmpeg ch_layout instead of deprecated channel_layout/channels (#1536)

Co-authored-by: whatdoineed2do/Ray <whatdoineed2do@nospam.gmail.com>
This commit is contained in:
whatdoineed2do
2022-10-06 16:09:01 +01:00
committed by GitHub
parent ce5f9c1e7a
commit 94c28386a6
3 changed files with 76 additions and 1 deletions

View File

@@ -452,7 +452,11 @@ scan_metadata_ffmpeg(struct media_file_info *mfi, const char *file)
codec_id = ctx->streams[i]->codecpar->codec_id;
sample_rate = ctx->streams[i]->codecpar->sample_rate;
sample_fmt = ctx->streams[i]->codecpar->format;
#ifdef HAVE_FFMPEG_CH_LAYOUT
channels = ctx->streams[i]->codecpar->ch_layout.nb_channels;
#else
channels = ctx->streams[i]->codecpar->channels;
#endif
switch (codec_type)
{
case AVMEDIA_TYPE_VIDEO: