diff mbox series

[FFmpeg-devel,076/281] idroq: convert to new channel layout API

Message ID 20220113015101.4-77-jamrial@gmail.com
State Accepted
Commit 59530185c9f5b030fadd204a71268ae3255e5740
Headers show
Series New channel layout API | expand

Checks

Context Check Description
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 fail Make fate failed

Commit Message

James Almer Jan. 13, 2022, 1:50 a.m. UTC
From: Vittorio Giovara <vittorio.giovara@gmail.com>

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/idroqdec.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c
index 0c8b7278e9..c9fc972780 100644
--- a/libavformat/idroqdec.c
+++ b/libavformat/idroqdec.c
@@ -185,18 +185,16 @@  static int roq_read_packet(AVFormatContext *s,
                 st->codecpar->codec_id = AV_CODEC_ID_ROQ_DPCM;
                 st->codecpar->codec_tag = 0;  /* no tag */
                 if (chunk_type == RoQ_SOUND_STEREO) {
-                    st->codecpar->channels       = 2;
-                    st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
+                    st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
                 } else {
-                    st->codecpar->channels       = 1;
-                    st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+                    st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
                 }
-                roq->audio_channels    = st->codecpar->channels;
+                roq->audio_channels = st->codecpar->ch_layout.nb_channels;
                 st->codecpar->sample_rate = RoQ_AUDIO_SAMPLE_RATE;
                 st->codecpar->bits_per_coded_sample = 16;
-                st->codecpar->bit_rate = st->codecpar->channels * st->codecpar->sample_rate *
+                st->codecpar->bit_rate = roq->audio_channels * st->codecpar->sample_rate *
                     st->codecpar->bits_per_coded_sample;
-                st->codecpar->block_align = st->codecpar->channels * st->codecpar->bits_per_coded_sample;
+                st->codecpar->block_align = roq->audio_channels * st->codecpar->bits_per_coded_sample;
             }
         case RoQ_QUAD_VQ:
             if (chunk_type == RoQ_QUAD_VQ) {