diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-03-31 14:04:07 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:32 -0300 |
commit | 53a132f0c5a067c1f49bd4dc3af60b833e42598a (patch) | |
tree | e775a079907a3e612832598c0518eec7c3f6bc70 /libavformat/flvenc.c | |
parent | ce5165f8ada0f2744a23af0b94fe32ab71c75255 (diff) | |
download | ffmpeg-53a132f0c5a067c1f49bd4dc3af60b833e42598a.tar.gz |
flv: 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>
Diffstat (limited to 'libavformat/flvenc.c')
-rw-r--r-- | libavformat/flvenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 66c530a2ff..429732297d 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -138,7 +138,7 @@ static int get_audio_flags(AVFormatContext *s, AVCodecParameters *par) "FLV only supports wideband (16kHz) Speex audio\n"); return AVERROR(EINVAL); } - if (par->channels != 1) { + if (par->ch_layout.nb_channels != 1) { av_log(s, AV_LOG_ERROR, "FLV only supports mono Speex audio\n"); return AVERROR(EINVAL); } @@ -178,7 +178,7 @@ error: } } - if (par->channels > 1) + if (par->ch_layout.nb_channels > 1) flags |= FLV_STEREO; switch (par->codec_id) { @@ -342,7 +342,7 @@ static void write_metadata(AVFormatContext *s, unsigned int ts) put_amf_double(pb, flv->audio_par->codec_id == AV_CODEC_ID_PCM_U8 ? 8 : 16); put_amf_string(pb, "stereo"); - put_amf_bool(pb, flv->audio_par->channels == 2); + put_amf_bool(pb, flv->audio_par->ch_layout.nb_channels == 2); put_amf_string(pb, "audiocodecid"); put_amf_double(pb, flv->audio_par->codec_tag); @@ -507,8 +507,8 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i if (!par->extradata_size && (flv->flags & FLV_AAC_SEQ_HEADER_DETECT)) { PutBitContext pbc; int samplerate_index; - int channels = flv->audio_par->channels - - (flv->audio_par->channels == 8 ? 1 : 0); + int channels = flv->audio_par->ch_layout.nb_channels + - (flv->audio_par->ch_layout.nb_channels == 8 ? 1 : 0); uint8_t data[2]; for (samplerate_index = 0; samplerate_index < 16; |