diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-03-31 14:15:26 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:33 -0300 |
commit | 92e9b6ab6dcd8463f7a280a700438927195ba6ff (patch) | |
tree | 100a372768ddbdf1c90ec05a79044feafd96ee73 | |
parent | f36e9b30b063c9ab0104007fdad2a78ec2b48070 (diff) | |
download | ffmpeg-92e9b6ab6dcd8463f7a280a700438927195ba6ff.tar.gz |
gxf: 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/gxf.c | 9 | ||||
-rw-r--r-- | libavformat/gxfenc.c | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/libavformat/gxf.c b/libavformat/gxf.c index 6f370c1b57..d96e0796f4 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -143,8 +143,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { case 9: st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_PCM_S24LE; - 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 = 48000; st->codecpar->bit_rate = 3 * 1 * 48000 * 8; st->codecpar->block_align = 3 * 1; @@ -153,8 +152,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { case 10: st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; - 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 = 48000; st->codecpar->bit_rate = 2 * 1 * 48000 * 8; st->codecpar->block_align = 2 * 1; @@ -163,8 +161,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { case 17: st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_AC3; - st->codecpar->channels = 2; - st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; + st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; st->codecpar->sample_rate = 48000; break; case 26: /* AVCi50 / AVCi100 (AVC Intra) */ diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 133d1e9fb3..e25d8764ba 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -714,7 +714,7 @@ static int gxf_write_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "only 48000hz sampling rate is allowed\n"); return -1; } - if (st->codecpar->channels != 1) { + if (st->codecpar->ch_layout.nb_channels != 1) { av_log(s, AV_LOG_ERROR, "only mono tracks are allowed\n"); return -1; } |