diff options
author | Jan Ekström <jeebjp@gmail.com> | 2023-02-07 21:37:10 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2023-02-14 21:10:42 +0200 |
commit | 02ddfeadbee52c1ad8c023a93594a8cb957e11db (patch) | |
tree | 9da6881420041368eaccf3e454ef90fc6d38f2f1 /libavformat/movenc.c | |
parent | 264cf752144ef109e580d1d420eeceacb898f8f9 (diff) | |
download | ffmpeg-02ddfeadbee52c1ad8c023a93594a8cb957e11db.tar.gz |
avformat/movenc: allow writing out channel count in MP4 and 3GP
ISOBMFF (14496-12) made this field ('channelcount') in the
AudioSampleEntry structure non-template¹ somewhere before the
release of the 2022 edition. As for ETSI TS 126 244 AKA 3GPP
file format (V16.1.0, 2020-10), it does not seem contain any
references limiting the channelcount entry in AudioSampleEntry
or in its own definition of EVSSampleEntry.
fate-mov-mp4-chapters test had to be adjusted as it output a
mono vorbis stream, which would now be properly marked as such
in the container.
1: As per 14496-12:
Fields shown as “template” in the box descriptions are fields
which are coded with a default value unless a derived
specification defines their use and permits writers to use
other values than the default.
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index aca8b9d585..c4fcb5f8b1 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1241,13 +1241,7 @@ static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex avio_wb16(pb, 16); avio_wb16(pb, track->audio_vbr ? -2 : 0); /* compression ID */ } else { /* reserved for mp4/3gp */ - if (track->par->codec_id == AV_CODEC_ID_FLAC || - track->par->codec_id == AV_CODEC_ID_ALAC || - track->par->codec_id == AV_CODEC_ID_OPUS) { - avio_wb16(pb, track->par->ch_layout.nb_channels); - } else { - avio_wb16(pb, 2); - } + avio_wb16(pb, track->par->ch_layout.nb_channels); if (track->par->codec_id == AV_CODEC_ID_FLAC || track->par->codec_id == AV_CODEC_ID_ALAC) { avio_wb16(pb, track->par->bits_per_raw_sample); |