rso: convert to new channel layout API

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Vittorio Giovara 2017-03-31 18:21:52 +02:00 committed by James Almer
parent 271a9b632c
commit b76e878f5b
2 changed files with 2 additions and 3 deletions

View File

@ -62,8 +62,7 @@ static int rso_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->codec_tag = id;
st->codecpar->codec_id = codec;
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 = rate;
st->codecpar->block_align = 1;

View File

@ -34,7 +34,7 @@ static int rso_write_header(AVFormatContext *s)
if (!par->codec_tag)
return AVERROR_INVALIDDATA;
if (par->channels != 1) {
if (par->ch_layout.nb_channels != 1) {
av_log(s, AV_LOG_ERROR, "RSO only supports mono\n");
return AVERROR_INVALIDDATA;
}