aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/iss.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 16:34:03 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:33 -0300
commitaf6b3f2dbf0365a94815478969337265bee1f372 (patch)
treefc9b34e36d464261fee12bc04ab223b64bbc9b0c /libavformat/iss.c
parentfe078ff0ed7e0871cf615f5dff48829e273bc10d (diff)
downloadffmpeg-af6b3f2dbf0365a94815478969337265bee1f372.tar.gz
iss: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/iss.c')
-rw-r--r--libavformat/iss.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavformat/iss.c b/libavformat/iss.c
index c58c5923ba..f54ff8b0de 100644
--- a/libavformat/iss.c
+++ b/libavformat/iss.c
@@ -109,19 +109,20 @@ static av_cold int iss_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_ISS;
+
if (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;
}
+
st->codecpar->sample_rate = 44100;
if(rate_divisor > 0)
st->codecpar->sample_rate /= rate_divisor;
st->codecpar->bits_per_coded_sample = 4;
- st->codecpar->bit_rate = st->codecpar->channels * st->codecpar->sample_rate
- * st->codecpar->bits_per_coded_sample;
+ st->codecpar->bit_rate = st->codecpar->ch_layout.nb_channels *
+ st->codecpar->sample_rate *
+ st->codecpar->bits_per_coded_sample;
st->codecpar->block_align = iss->packet_size;
avpriv_set_pts_info(st, 32, 1, st->codecpar->sample_rate);
@@ -138,8 +139,8 @@ static int iss_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->stream_index = 0;
pkt->pts = avio_tell(s->pb) - iss->sample_start_pos;
- if(s->streams[0]->codecpar->channels > 0)
- pkt->pts /= s->streams[0]->codecpar->channels*2;
+ if (s->streams[0]->codecpar->ch_layout.nb_channels > 0)
+ pkt->pts /= s->streams[0]->codecpar->ch_layout.nb_channels * 2;
return 0;
}