aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 17:02:25 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:34 -0300
commit847e6393ac4cf07731bf1ae2b089ebeaccf9a53d (patch)
treedd48e9af728f425d89bf2caaf9e562d209e94c5a
parent7baa1807b8204a1cae3c657d203f1a05ee14b79f (diff)
downloadffmpeg-847e6393ac4cf07731bf1ae2b089ebeaccf9a53d.tar.gz
mmf: 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>
-rw-r--r--libavformat/mmf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index 0c067a1025..4c3ef3456b 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -80,7 +80,7 @@ static int mmf_write_header(AVFormatContext *s)
return AVERROR(EINVAL);
}
- mmf->stereo = s->streams[0]->codecpar->channels > 1;
+ mmf->stereo = s->streams[0]->codecpar->ch_layout.nb_channels > 1;
if (mmf->stereo &&
s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
av_log(s, AV_LOG_ERROR, "Yamaha SMAF stereo is experimental, "
@@ -261,8 +261,7 @@ static int mmf_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->codec_id = AV_CODEC_ID_ADPCM_YAMAHA;
st->codecpar->sample_rate = rate;
- st->codecpar->channels = (params >> 7) + 1;
- st->codecpar->channel_layout = params >> 7 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
+ av_channel_layout_default(&st->codecpar->ch_layout, (params >> 7) + 1);
st->codecpar->bits_per_coded_sample = 4;
st->codecpar->bit_rate = st->codecpar->sample_rate *
st->codecpar->bits_per_coded_sample;