diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-03-31 18:20:54 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:36 -0300 |
commit | 2a4a3f51765a88376a0e5c0bcfc8da63f6a6fe62 (patch) | |
tree | a5c81e957f5bae3c590e11fad1c7fe0ee6854a63 | |
parent | 82f728828e8b477d82ea2f0b635be5568de55e30 (diff) | |
download | ffmpeg-2a4a3f51765a88376a0e5c0bcfc8da63f6a6fe62.tar.gz |
rpl: 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/rpl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/rpl.c b/libavformat/rpl.c index 459791ffd3..d025589bfc 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -194,23 +194,25 @@ static int rpl_read_header(AVFormatContext *s) audio_format = read_int(line, &endptr, &error); // audio format ID av_strlcpy(audio_codec, endptr, RPL_LINE_LENGTH); if (audio_format) { + int channels; ast = avformat_new_stream(s, NULL); if (!ast) return AVERROR(ENOMEM); ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; ast->codecpar->codec_tag = audio_format; ast->codecpar->sample_rate = read_line_and_int(pb, &error); // audio bitrate - ast->codecpar->channels = read_line_and_int(pb, &error); // number of audio channels + channels = read_line_and_int(pb, &error); // number of audio channels error |= read_line(pb, line, sizeof(line)); ast->codecpar->bits_per_coded_sample = read_int(line, &endptr, &error); // audio bits per sample av_strlcpy(audio_type, endptr, RPL_LINE_LENGTH); + ast->codecpar->ch_layout.nb_channels = channels; // At least one sample uses 0 for ADPCM, which is really 4 bits // per sample. if (ast->codecpar->bits_per_coded_sample == 0) ast->codecpar->bits_per_coded_sample = 4; ast->codecpar->bit_rate = ast->codecpar->sample_rate * - (int64_t)ast->codecpar->channels; + (int64_t)ast->codecpar->ch_layout.nb_channels; if (ast->codecpar->bit_rate > INT64_MAX / ast->codecpar->bits_per_coded_sample) return AVERROR_INVALIDDATA; ast->codecpar->bit_rate *= ast->codecpar->bits_per_coded_sample; |