aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/amr.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 13:29:35 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:30 -0300
commit2c01257819beb7fb6ac12d57a2ba3ccbfaf0be49 (patch)
treec8129e39b78c945b5e70ec3534a226baef2b57f7 /libavformat/amr.c
parent641761ac6e05f1cdafbd1a52b76a90b124daccd0 (diff)
downloadffmpeg-2c01257819beb7fb6ac12d57a2ba3ccbfaf0be49.tar.gz
amr: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/amr.c')
-rw-r--r--libavformat/amr.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/libavformat/amr.c b/libavformat/amr.c
index bc22c2f84f..f3e5b18113 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -100,33 +100,31 @@ static int amr_read_header(AVFormatContext *s)
st->codecpar->codec_tag = MKTAG('s', 'a', 'm', 'r');
st->codecpar->codec_id = AV_CODEC_ID_AMR_NB;
st->codecpar->sample_rate = 8000;
- st->codecpar->channels = 1;
- st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+ st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
back = read - sizeof(AMR_header);
} else if (!memcmp(header, AMRWB_header, sizeof(AMRWB_header))) {
st->codecpar->codec_tag = MKTAG('s', 'a', 'w', 'b');
st->codecpar->codec_id = AV_CODEC_ID_AMR_WB;
st->codecpar->sample_rate = 16000;
- st->codecpar->channels = 1;
- st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+ st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
back = read - sizeof(AMRWB_header);
} else if (!memcmp(header, AMRMC_header, sizeof(AMRMC_header))) {
st->codecpar->codec_tag = MKTAG('s', 'a', 'm', 'r');
st->codecpar->codec_id = AV_CODEC_ID_AMR_NB;
st->codecpar->sample_rate = 8000;
- st->codecpar->channels = AV_RL32(header + 12);
+ st->codecpar->ch_layout.nb_channels = AV_RL32(header + 12);
back = read - 4 - sizeof(AMRMC_header);
} else if (!memcmp(header, AMRWBMC_header, sizeof(AMRWBMC_header))) {
st->codecpar->codec_tag = MKTAG('s', 'a', 'w', 'b');
st->codecpar->codec_id = AV_CODEC_ID_AMR_WB;
st->codecpar->sample_rate = 16000;
- st->codecpar->channels = AV_RL32(header + 15);
+ st->codecpar->ch_layout.nb_channels = AV_RL32(header + 15);
back = read - 4 - sizeof(AMRWBMC_header);
} else {
return AVERROR_INVALIDDATA;
}
- if (st->codecpar->channels < 1)
+ if (st->codecpar->ch_layout.nb_channels < 1)
return AVERROR_INVALIDDATA;
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
@@ -188,8 +186,7 @@ static int amrnb_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
st->codecpar->codec_id = AV_CODEC_ID_AMR_NB;
st->codecpar->sample_rate = 8000;
- st->codecpar->channels = 1;
- st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+ st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
avpriv_set_pts_info(st, 64, 1, 8000);
@@ -246,8 +243,7 @@ static int amrwb_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
st->codecpar->codec_id = AV_CODEC_ID_AMR_WB;
st->codecpar->sample_rate = 16000;
- st->codecpar->channels = 1;
- st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+ st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
avpriv_set_pts_info(st, 64, 1, 16000);