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 60f539f9a4 avformat/movenc: write zero bits per channel for compressed 
version 2 audio
60f539f9a4 is described below

commit 60f539f9a4ada0a2e32b0365a85a1b68267f68c8
Author:     Baptiste Coudurier <[email protected]>
AuthorDate: Sat Nov 21 12:10:24 2026 -0800
Commit:     Baptiste Coudurier <[email protected]>
CommitDate: Mon Nov 23 07:54:44 2026 +0000

    avformat/movenc: write zero bits per channel for compressed version 2 audio
    
    QTFF sets constBitsPerChannel only for uncompressed audio, but IMA4 and
    MS ADPCM wrote 4. Keep the PCM depth, and 8 for alaw and ulaw as macOS 
avconvert writes.
    
    Signed-off-by: Baptiste Coudurier <[email protected]>
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 libavformat/movenc.c        |  7 ++++++-
 tests/fate/mov.mak          |  6 ++++++
 tests/ref/fate/mov-ima4-96k | 10 ++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index e0057dba3b..097f1bc106 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1522,7 +1522,12 @@ static int mov_write_audio_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContex
         avio_wb64(pb, av_double2int(track->par->sample_rate));
         avio_wb32(pb, track->par->ch_layout.nb_channels);
         avio_wb32(pb, 0x7F000000);
-        avio_wb32(pb, av_get_bits_per_sample(track->par->codec_id));
+        /* constBitsPerChannel: keep the PCM depth, including 8 for A-law and 
mu-law */
+        if (track->par->codec_id >= AV_CODEC_ID_PCM_S16LE &&
+            track->par->codec_id <  AV_CODEC_ID_ADPCM_IMA_QT)
+            avio_wb32(pb, av_get_bits_per_sample(track->par->codec_id));
+        else
+            avio_wb32(pb, 0);
         avio_wb32(pb, mov_get_lpcm_flags(track->par->codec_id));
         avio_wb32(pb, track->sample_size);
         avio_wb32(pb, get_samples_per_packet(track));
diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 3af9918279..96ee5f9f14 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -441,6 +441,12 @@ FATE_MOV_FFMPEG-$(call TRANSCODE, PCM_F32LE, MP4 MOV, 
WAV_DEMUXER PAN_FILTER) \
 fate-mov-mp4-pcm-float: tests/data/asynth-44100-1.wav
 fate-mov-mp4-pcm-float: CMD = transcode wav 
$(TARGET_PATH)/tests/data/asynth-44100-1.wav mp4 "-af 
aresample,pan=FR+FL+FR|c0=c0|c1=c0|c2=c0 -c:a pcm_f32le" "-map 0 -c copy 
-frames:a 0"
 
+# Test IMA4 above 65535 Hz, in a version 2 sound description
+FATE_MOV_FFMPEG-$(call REMUX, MOV, ADPCM_IMA_QT_ENCODER WAV_DEMUXER 
PCM_S16LE_DECODER ARESAMPLE_FILTER) \
+                          += fate-mov-ima4-96k
+fate-mov-ima4-96k: tests/data/asynth-96000-1.wav
+fate-mov-ima4-96k: CMD = transcode wav 
$(TARGET_PATH)/tests/data/asynth-96000-1.wav mov "-af aresample -t 0.002 -c:a 
adpcm_ima_qt" "-c copy"
+
 fate-mov-pcm-remux: tests/data/asynth-44100-1.wav
 fate-mov-pcm-remux: CMD = md5 -i $(TARGET_PATH)/tests/data/asynth-44100-1.wav 
-map 0 -c copy -fflags +bitexact -f mp4
 fate-mov-pcm-remux: CMP = oneline
diff --git a/tests/ref/fate/mov-ima4-96k b/tests/ref/fate/mov-ima4-96k
new file mode 100644
index 0000000000..8858deff64
--- /dev/null
+++ b/tests/ref/fate/mov-ima4-96k
@@ -0,0 +1,10 @@
+de230f69f5ffae2812c3328050cbab50 *tests/data/fate/mov-ima4-96k.mov
+791 tests/data/fate/mov-ima4-96k.mov
+#tb 0: 1/96000
+#media_type 0: audio
+#codec_id 0: adpcm_ima_qt
+#sample_rate 0: 96000
+#channel_layout_name 0: mono
+0,          0,          0,       64,       34, 0x33061145
+0,         64,         64,       64,       34, 0xcfc30fe0
+0,        128,        128,       64,       34, 0x20990c9a

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to