This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 4ead07cd8c1e059533eb8346b2a5afb676c3cb83 Author: Baptiste Coudurier <[email protected]> AuthorDate: Sun Nov 22 22:34:38 2026 -0800 Commit: Baptiste Coudurier <[email protected]> CommitDate: Tue Nov 24 02:32:39 2026 +0000 avformat/movenc: drop CENC entries of every track in a shared moof Only the first track was flushed, so later tracks repeated stale IVs in senc. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Baptiste Coudurier <[email protected]> --- libavformat/movenc.c | 5 ++--- tests/fate/mov.mak | 6 ++++++ tests/ref/fate/mov-aac-cenc-frag-2tracks | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 097f1bc106..b4d190c678 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6954,6 +6954,8 @@ static int mov_finish_fragment(MOVMuxContext *mov, MOVTrack *track, track->cluster, track->entry * sizeof(*track->cluster)); track->entry_written += track->entry; } + if (track->cenc.aes_ctr) + ff_mov_cenc_flush(&track->cenc); track->entry = 0; track->entries_flushed = 0; track->end_reliable = 0; @@ -7143,9 +7145,6 @@ static int mov_flush_fragment(AVFormatContext *s, int force) mov_write_moof_tag(s->pb, mov, moof_tracks, mdat_size); mov->fragments++; - if (track->cenc.aes_ctr) - ff_mov_cenc_flush(&track->cenc); - avio_wb32(s->pb, mdat_size + 8); ffio_wfourcc(s->pb, "mdat"); mdat_start = avio_tell(s->pb); diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index c48e47135a..3e554d9098 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -281,6 +281,12 @@ $(eval $(call FATE_MOV_CENC_TEST,h264_iso,H264,matroska,MATROSKA,h264/dts_5frame $(eval $(call FATE_MOV_CENC_TEST,hevc,HEVC,hevc,HEVC,hevc-conformance/ipcm_A_NEC_3.bit)) $(eval $(call FATE_MOV_CENC_TEST,hevc_iso,HEVC,mov,MOV,hevc/extradata-reload-multi-stsd.mov)) +# Two encrypted tracks sharing each moof. +FATE_MOV_FFMPEG_SAMPLES-$(call REMUX, MP4 MOV, AAC_DECODER) += fate-mov-aac-cenc-frag-2tracks +fate-mov-aac-cenc-frag-2tracks: CMD = transcode mp4 $(TARGET_SAMPLES)/aac/al04_44.mp4 mp4 \ + "-map 0:a -map 0:a -t 0.2 -c:a copy -movflags +empty_moov -frag_duration 50000 -encryption_scheme cenc-aes-ctr -encryption_key 00112233445566778899aabbccddeeff -encryption_kid 00112233445566778899aabbccddeeff" \ + "-map 0:a -c copy" "" "" "-decryption_key 00112233445566778899aabbccddeeff" + # avif muxing - still image with 1 item. FATE_MOV_FFMPEG_SAMPLES-$(call REMUX, AVIF OBU, AV1_DECODER AV1_PARSER) \ += fate-mov-avif-mux-still-image-1-item diff --git a/tests/ref/fate/mov-aac-cenc-frag-2tracks b/tests/ref/fate/mov-aac-cenc-frag-2tracks new file mode 100644 index 0000000000..7b4234b541 --- /dev/null +++ b/tests/ref/fate/mov-aac-cenc-frag-2tracks @@ -0,0 +1,32 @@ +fe01266aab7033000cbd8c1bfa564e1c *tests/data/fate/mov-aac-cenc-frag-2tracks.mp4 +6099 tests/data/fate/mov-aac-cenc-frag-2tracks.mp4 +#extradata 0: 9, 0x0320011c +#extradata 1: 9, 0x0320011c +#tb 0: 1/44100 +#media_type 0: audio +#codec_id 0: aac +#sample_rate 0: 44100 +#channel_layout_name 0: mono +#tb 1: 1/44100 +#media_type 1: audio +#codec_id 1: aac +#sample_rate 1: 44100 +#channel_layout_name 1: mono +0, 0, 0, 1024, 194, 0xd4bd423e +1, 0, 0, 1024, 194, 0xd4bd423e +0, 1024, 1024, 1024, 169, 0xb6834b02 +1, 1024, 1024, 1024, 169, 0xb6834b02 +0, 2048, 2048, 1024, 197, 0xc5f75be9 +1, 2048, 2048, 1024, 197, 0xc5f75be9 +0, 3072, 3072, 1024, 200, 0x65be5ab8 +1, 3072, 3072, 1024, 200, 0x65be5ab8 +0, 4096, 4096, 1024, 193, 0x130c5a84 +1, 4096, 4096, 1024, 193, 0x130c5a84 +0, 5120, 5120, 1024, 183, 0x7d505262 +1, 5120, 5120, 1024, 183, 0x7d505262 +0, 6144, 6144, 1024, 203, 0xf8665d27 +1, 6144, 6144, 1024, 203, 0xf8665d27 +0, 7168, 7168, 1024, 191, 0x4f765d5d +1, 7168, 7168, 1024, 191, 0x4f765d5d +0, 8192, 8192, 1024, 196, 0x4ac86327 +1, 8192, 8192, 1024, 196, 0x4ac86327 -- 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]
