This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 34ebcabcf1 avformat/aiffenc: write CHAN chunk after COMM COMM is where 
the channel count is indicated Channel count can be useful when parsing the 
CHAN chunk
34ebcabcf1 is described below

commit 34ebcabcf11df63b4c16b4669d267835012df5ac
Author:     Tim Walker <[email protected]>
AuthorDate: Wed Jun 3 01:39:29 2026 +0200
Commit:     James Almer <[email protected]>
CommitDate: Wed Jun 3 14:32:19 2026 +0000

    avformat/aiffenc: write CHAN chunk after COMM
    COMM is where the channel count is indicated
    Channel count can be useful when parsing the CHAN chunk
---
 libavformat/aiffenc.c          | 14 ++++++++------
 tests/ref/fate/id3v2-utf16-bom |  2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 2cd1119409..db65c09f11 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -147,12 +147,6 @@ static int aiff_write_header(AVFormatContext *s)
         avio_wb32(pb, 0xA2805140);
     }
 
-    if (par->ch_layout.order == AV_CHANNEL_ORDER_NATIVE && 
par->ch_layout.nb_channels > 2) {
-        ffio_wfourcc(pb, "CHAN");
-        avio_wb32(pb, 12);
-        ff_mov_write_chan(pb, par->ch_layout.u.mask);
-    }
-
     put_meta(s, "title",     MKBETAG('N', 'A', 'M', 'E'));
     put_meta(s, "author",    MKBETAG('A', 'U', 'T', 'H'));
     put_meta(s, "copyright", MKBETAG('(', 'c', ')', ' '));
@@ -193,6 +187,14 @@ static int aiff_write_header(AVFormatContext *s)
         avio_write(pb, par->extradata, par->extradata_size);
     }
 
+    /* CHAN chunk; a decoder may use the channel count when parsing this chunk,
+     * so let's write it after the COMM chunk which indicates said channel 
count. */
+    if (par->ch_layout.order == AV_CHANNEL_ORDER_NATIVE && 
par->ch_layout.nb_channels > 2) {
+        ffio_wfourcc(pb, "CHAN");
+        avio_wb32(pb, 12);
+        ff_mov_write_chan(pb, par->ch_layout.u.mask);
+    }
+
     /* Sound data chunk */
     ffio_wfourcc(pb, "SSND");
     aiff->ssnd = avio_tell(pb);         /* Sound chunk size */
diff --git a/tests/ref/fate/id3v2-utf16-bom b/tests/ref/fate/id3v2-utf16-bom
index 99d1bd064d..99e54deef6 100644
--- a/tests/ref/fate/id3v2-utf16-bom
+++ b/tests/ref/fate/id3v2-utf16-bom
@@ -1,4 +1,4 @@
-9b8bfdf87a8d3d089819ef9f6f264ec4 *tests/data/fate/id3v2-utf16-bom.aiff
+8e292c72670bc4b09b05b2eb11edfa70 *tests/data/fate/id3v2-utf16-bom.aiff
 885482 tests/data/fate/id3v2-utf16-bom.aiff
 #tb 0: 1/90000
 #media_type 0: video

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to