summaryrefslogtreecommitdiff
path: root/libavformat/mpegenc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 17:43:04 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:35 -0300
commit203a7bd7851967259d2e9f200295137d36290e3c (patch)
treec69bf94b29bc7df706afe4fc7b20d5f57f621cde /libavformat/mpegenc.c
parentf4602e9ba6e38f3b680b5bd93c25057fae4c9374 (diff)
mpegenc: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/mpegenc.c')
-rw-r--r--libavformat/mpegenc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 64248695bd..59db1e5f00 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -380,14 +380,14 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
av_log(ctx, AV_LOG_INFO, "\n");
return AVERROR(EINVAL);
}
- if (st->codecpar->channels > 8) {
+ if (st->codecpar->ch_layout.nb_channels > 8) {
av_log(ctx, AV_LOG_ERROR, "At most 8 channels allowed for LPCM streams.\n");
return AVERROR(EINVAL);
}
stream->lpcm_header[0] = 0x0c;
- stream->lpcm_header[1] = (st->codecpar->channels - 1) | (j << 4);
+ stream->lpcm_header[1] = (st->codecpar->ch_layout.nb_channels - 1) | (j << 4);
stream->lpcm_header[2] = 0x80;
- stream->lpcm_align = st->codecpar->channels * 2;
+ stream->lpcm_align = st->codecpar->ch_layout.nb_channels * 2;
} else if (st->codecpar->codec_id == AV_CODEC_ID_PCM_DVD) {
int freq;
@@ -404,10 +404,10 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
stream->lpcm_header[0] = 0x0c;
stream->lpcm_header[1] = (freq << 4) |
(((st->codecpar->bits_per_coded_sample - 16) / 4) << 6) |
- st->codecpar->channels - 1;
+ st->codecpar->ch_layout.nb_channels - 1;
stream->lpcm_header[2] = 0x80;
stream->id = lpcm_id++;
- stream->lpcm_align = st->codecpar->channels * st->codecpar->bits_per_coded_sample / 8;
+ stream->lpcm_align = st->codecpar->ch_layout.nb_channels * st->codecpar->bits_per_coded_sample / 8;
} else if (st->codecpar->codec_id == AV_CODEC_ID_MLP ||
st->codecpar->codec_id == AV_CODEC_ID_TRUEHD) {
av_log(ctx, AV_LOG_ERROR, "Support for muxing audio codec %s not implemented.\n",