aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-12-03 20:36:30 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:37 -0300
commit4a0bd4393c761e1e8c27efbdc0f2c85cd572958e (patch)
tree91ffefd86284c6e0addc7a7c1ea7f86427509524
parent5bcf9029c85de3bafdd48927b9e64d281f889cfe (diff)
downloadffmpeg-4a0bd4393c761e1e8c27efbdc0f2c85cd572958e.tar.gz
scd: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/scd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/scd.c b/libavformat/scd.c
index 0ed5322a14..91b2262ff7 100644
--- a/libavformat/scd.c
+++ b/libavformat/scd.c
@@ -194,7 +194,7 @@ static int scd_read_track(AVFormatContext *s, SCDTrackHeader *track, int index)
par = st->codecpar;
par->codec_type = AVMEDIA_TYPE_AUDIO;
- par->channels = (int)track->num_channels;
+ par->ch_layout.nb_channels = (int)track->num_channels;
par->sample_rate = (int)track->sample_rate;
st->index = index;
st->start_time = 0;
@@ -218,7 +218,7 @@ static int scd_read_track(AVFormatContext *s, SCDTrackHeader *track, int index)
case SCD_TRACK_ID_PCM:
par->codec_id = AV_CODEC_ID_PCM_S16BE;
par->bits_per_coded_sample = 16;
- par->block_align = par->bits_per_coded_sample * par->channels / 8;
+ par->block_align = par->bits_per_coded_sample * par->ch_layout.nb_channels / 8;
break;
case SCD_TRACK_ID_MP3:
par->codec_id = AV_CODEC_ID_MP3;
@@ -325,8 +325,8 @@ static int scd_read_packet(AVFormatContext *s, AVPacket *pkt)
}
if (trk->data_type == SCD_TRACK_ID_PCM) {
- pkt->pts = trk->bytes_read / (par->channels * sizeof(uint16_t));
- pkt->duration = size / (par->channels * sizeof(int16_t));
+ pkt->pts = trk->bytes_read / (par->ch_layout.nb_channels * sizeof(uint16_t));
+ pkt->duration = size / (par->ch_layout.nb_channels * sizeof(int16_t));
}
trk->bytes_read += ret;