]> git.alsa-project.org Git - tinycompress.git/commitdiff
ffplay: Use new ffmpeg channel layout API
authorfossdd <fossdd@pwned.life>
Wed, 9 Oct 2024 11:22:32 +0000 (13:22 +0200)
committerVinod Koul <3178504+vinodkoul@users.noreply.github.com>
Wed, 9 Oct 2024 11:31:31 +0000 (17:01 +0530)
AVCodecParameters.channels got removed in ffmpeg 7 in favour of the new
channel layout API.

https://github.com/FFmpeg/FFmpeg/commit/65ddc74988245a01421a63c5cffa4d900c47117c

Co-Authored-By: Antonio Rojas <arojas@archlinux.org>
src/utils-lgpl/fcplay.c

index aff091579d7d40dd09e3484ae0a94f852bf1f83e..eac0712b907c91444cd052bb31e41489e2da30b5 100644 (file)
@@ -240,8 +240,8 @@ static int parse_file(char *file, struct snd_codec *codec)
                        if (!filled) {
                                /* we fill params from 1st audio stream */
                                codec->id = get_codec_id(stream->codecpar->codec_id);
-                               codec->ch_in = stream->codecpar->channels;
-                               codec->ch_out = stream->codecpar->channels;
+                               codec->ch_in = stream->codecpar->ch_layout.nb_channels;
+                               codec->ch_out = stream->codecpar->ch_layout.nb_channels;
                                codec->sample_rate = stream->codecpar->sample_rate;
                                codec->bit_rate = ctx->bit_rate;
                                codec->profile = stream->codecpar->profile;
@@ -273,7 +273,7 @@ static int parse_file(char *file, struct snd_codec *codec)
                                fprintf(stderr, "  Bits coded: %d", stream->codecpar->bits_per_coded_sample);
                                fprintf(stderr, "  Profile: %d", stream->codecpar->profile);
                                fprintf(stderr, "  Codec tag: %d", stream->codecpar->codec_tag);
-                               fprintf(stderr, "  Channels: %d", stream->codecpar->channels);
+                               fprintf(stderr, "  Channels: %d", stream->codecpar->ch_layout.nb_channels);
                                fprintf(stderr, "  Sample rate: %d", stream->codecpar->sample_rate);
                                fprintf(stderr, "  block_align: %d", stream->codecpar->block_align);
                                if (codec->id == SND_AUDIOCODEC_FLAC) {