|
|
|
@ -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; |
|
|
|
|