scd: convert to new channel layout API

Signed-off-by: James Almer <jamrial@gmail.com>
release/5.1
James Almer 3 years ago
parent 5bcf9029c8
commit 4a0bd4393c
  1. 8
      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;

Loading…
Cancel
Save