aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 18:19:23 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:36 -0300
commit82f728828e8b477d82ea2f0b635be5568de55e30 (patch)
treec5072bbd828c8dc8fc9b5d164236638d843409c5
parentfcf5aad1a5304c90b055ad39109e58c612f359b9 (diff)
downloadffmpeg-82f728828e8b477d82ea2f0b635be5568de55e30.tar.gz
rm: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/rmdec.c5
-rw-r--r--libavformat/rmenc.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index b0a38bee83..b6b72e6ead 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -148,8 +148,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
if (bytes_per_minute)
st->codecpar->bit_rate = 8LL * bytes_per_minute / 60;
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;
st->codecpar->codec_id = AV_CODEC_ID_RA_144;
ast->deint_id = DEINT_ID_INT0;
@@ -185,7 +184,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
}
st->codecpar->sample_rate = avio_rb16(pb);
avio_rb32(pb);
- st->codecpar->channels = avio_rb16(pb);
+ st->codecpar->ch_layout.nb_channels = avio_rb16(pb);
if (version == 5) {
ast->deint_id = avio_rl32(pb);
avio_read(pb, buf, 4);
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 1b2b0ecf38..1fba092b88 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -228,7 +228,7 @@ static int rv10_write_header(AVFormatContext *ctx,
avio_wb32(s, 0); /* unknown */
avio_wb16(s, stream->par->sample_rate); /* sample rate */
avio_wb32(s, 0x10); /* unknown */
- avio_wb16(s, stream->par->channels);
+ avio_wb16(s, stream->par->ch_layout.nb_channels);
put_str8(s, "Int0"); /* codec name */
if (stream->par->codec_tag) {
avio_w8(s, 4); /* tag length */