From 75cdd597eb06e2e742613729bb2a1a3c363b12d5 Mon Sep 17 00:00:00 2001 From: Jason Z <68634004+tiffsequence@users.noreply.github.com> Date: Fri, 9 Oct 2026 20:28:08 -0700 Subject: [PATCH] add box patch test appending into a box without children New mp4box-patch_box subtest "add-box-empty-container": appends a 'name' box into the tmcd sample entry created by -add self:tc, which has no child box. Fails on gpac master (patch silently dropped), passes with the fix for gpac/gpac#3970. --- .../mp4box-patch_box-add-box-empty-container.hash | 1 + media/boxpatch/box_add_empty_container.xml | 12 ++++++++++++ scripts/mp4box-boxpatch.sh | 5 +++++ 3 files changed, 18 insertions(+) create mode 100644 hash_refs/mp4box-patch_box-add-box-empty-container.hash create mode 100644 media/boxpatch/box_add_empty_container.xml diff --git a/hash_refs/mp4box-patch_box-add-box-empty-container.hash b/hash_refs/mp4box-patch_box-add-box-empty-container.hash new file mode 100644 index 00000000..a1fecfca --- /dev/null +++ b/hash_refs/mp4box-patch_box-add-box-empty-container.hash @@ -0,0 +1 @@ +Õìf‘�¶g¯E åß»dVÌì \ No newline at end of file diff --git a/media/boxpatch/box_add_empty_container.xml b/media/boxpatch/box_add_empty_container.xml new file mode 100644 index 00000000..cf52657d --- /dev/null +++ b/media/boxpatch/box_add_empty_container.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/scripts/mp4box-boxpatch.sh b/scripts/mp4box-boxpatch.sh index 80e73641..a8c053f8 100755 --- a/scripts/mp4box-boxpatch.sh +++ b/scripts/mp4box-boxpatch.sh @@ -39,6 +39,11 @@ dst2="$TEMP_DIR/fixed.mp4" do_test "$MP4BOX -no-check -patch $MEDIA_DIR/boxpatch/hdlr_add.xml $dst -out $dst2" "patch-hdlr" do_hash_test $dst "patch-hdlr" +#append into a box with no child box yet (tmcd sample entry) +mp4file1="$TEMP_DIR/add-empty-container.mp4" +do_test "$MP4BOX -add $MEDIA_DIR/auxiliary_files/enst_video.h264 -add self:tc=25,0,0,0,0:fps=25 -patch $MEDIA_DIR/boxpatch/box_add_empty_container.xml -new $mp4file1" "add-box-empty-container" +do_hash_test $mp4file1 "add-box-empty-container" + test_end