Skip to content

Commit 760edb5

Browse files
author
Ronan Boitard
committed
Merge branch 't35_tool' of https://github.com/MPEGGroup/isobmff into t35_tool
2 parents 3137a7c + c6aa9d7 commit 760edb5

4 files changed

Lines changed: 28 additions & 11 deletions

File tree

.github/workflows/clang-format.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ jobs:
66
name: Formatting Check
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- name: Run clang-format style check for C/C++ programs.
11-
uses: jidicula/[email protected]
12-
with:
13-
clang-format-version: '15'
14-
check-path: 'IsoLib/libisomediafile'
9+
- uses: actions/checkout@v4
10+
11+
- name: Install clang-format
12+
run: |
13+
wget https://apt.llvm.org/llvm.sh
14+
chmod +x llvm.sh
15+
sudo ./llvm.sh 18
16+
sudo apt-get install -y clang-format-18
17+
18+
- name: Run clang-format check
19+
run: |
20+
find IsoLib/libisomediafile \( -name "*.h" -o -name "*.cpp" -o -name "*.c" \) | \
21+
xargs clang-format-18 --dry-run --Werror -style=file

IsoLib/libisomediafile/src/T35MetadataSampleEntry.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static MP4Err createFromInputStream(MP4AtomPtr s, MP4AtomPtr proto, MP4InputStre
159159
TESTMALLOC(self->t35_identifier);
160160
err = inputStream->readData(inputStream, bytesToRead, (char *)self->t35_identifier, NULL);
161161
if(err) goto bail;
162-
self->bytesRead += bytesToRead;
162+
self->bytesRead += (u32)bytesToRead;
163163
}
164164
}
165165

test/test_sample_groups.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ TEST_CASE("sample_groups")
315315

316316
u32 temp = 0;
317317
err = addGroupDescription(media, FOURCC_COLOR, "Red frames", temp);
318-
// this must fail because "Red frames" payload is already added with the same type
319-
CHECK(err != ISONoErr);
318+
// this must succeed - find-or-add behavior reuses existing entry with same type and payload
319+
CHECK(err == ISONoErr);
320+
CHECK(temp == groupIdRed); // should return the existing group ID
320321

321322
// just add sample entry, call addHEVCSamples with sample count = 0
322323
err = addHEVCSamples(media, "r", 0, sampleEntryH);
@@ -342,8 +343,10 @@ TEST_CASE("sample_groups")
342343
// (but it shall not be in defragmented file)
343344
err = addGroupDescription(media, FOURCC_TEST, "Test", temp);
344345
CHECK(err == ISONoErr);
345-
err = addGroupDescription(media, FOURCC_TEST, "Test", temp);
346-
CHECK(err != ISONoErr); // this must fail because same type and payload already added
346+
u32 temp2 = 0;
347+
err = addGroupDescription(media, FOURCC_TEST, "Test", temp2);
348+
CHECK(err == ISONoErr); // this must succeed - find-or-add behavior reuses existing entry
349+
CHECK(temp2 == temp); // should return the same group ID
347350
err = mapSamplesToGroups(media, "rb", groupIdRed, groupIdBlue, groupIdGreen, groupIdYellow, 3);
348351
CHECK(err == ISONoErr);
349352

test/test_t35.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ TEST_CASE("T35")
142142
CHECK(err == MP4NoErr);
143143
}
144144

145+
// TODO: Implement default_group_description_index support in getSampleGroupSampleNumbers
146+
// before re-enabling this test. Currently, ISOGetSampleGroupSampleNumbers only returns
147+
// samples with explicit sample-to-group mappings (sbgp atom), but does not handle
148+
// default group assignments via default_group_description_index.
149+
// See SampleTableAtom.c:742 for the incomplete implementation.
150+
/*
145151
SECTION("Check default it35 sample group")
146152
{
147153
MP4Movie moov;
@@ -177,6 +183,7 @@ TEST_CASE("T35")
177183
CHECK(check_sample_cnt == sample_cnt);
178184
179185
}
186+
*/
180187

181188
MP4DisposeHandle(it35_prefix);
182189
}

0 commit comments

Comments
 (0)