Skip to content

Commit d39849d

Browse files
committed
Cleanup
1 parent f50ea4a commit d39849d

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/AudioTools/AudioCodecs/MP4Parser.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MP4Parser {
3939
const uint8_t* data =
4040
nullptr; ///< Pointer to box payload (not including header)
4141
size_t data_size = 0; ///< Size of payload (not including header)
42-
size_t size = 0; ///< Size of payload (not including header)
42+
size_t size = 0; ///< Size of payload including subboxes (not including header)
4343
int level = 0; ///< Nesting depth
4444
uint64_t offset = 0; ///< File offset where box starts
4545
bool is_complete = false; ///< True if the box data is complete
@@ -107,7 +107,6 @@ class MP4Parser {
107107
fileOffset = 0;
108108
levelStack.clear();
109109
box.is_complete = true; // Start with no open box
110-
// box.data_buffer.reset();
111110
box.data = nullptr;
112111
box.size = 0;
113112
box.level = 0;
@@ -364,6 +363,7 @@ class MP4Parser {
364363
bool isContainerBox(const char* type) {
365364
// fill with default values if nothing has been defined
366365
if (containers.empty()) {
366+
// pure containers
367367
static const char* containers_str[] = {
368368
"moov", "trak", "mdia", "minf", "stbl", "edts", "dinf", "udta",
369369
"ilst", "moof", "traf", "mfra", "tref", "iprp", "sinf", "schi"};
@@ -373,6 +373,7 @@ class MP4Parser {
373373
info.start = 0;
374374
containers.push_back(info);
375375
}
376+
// container with data
376377
ContainerInfo info;
377378
info.name = "meta";
378379
info.start = 4; // 4 bytes: version (1 byte) + flags (3 bytes)
@@ -397,18 +398,6 @@ class MP4Parser {
397398
return 0;
398399
}
399400

400-
/**
401-
* @brief Checks if a box type is a persisted box.
402-
* @param type Box type string.
403-
* @return true if persisted, false otherwise.
404-
*/
405-
bool isPersistedBox(const char* type) const {
406-
static const char* persisted[] = {"stsz"};
407-
for (const char* p : persisted)
408-
if (StrView(type) == p) return true;
409-
return false;
410-
}
411-
412401
/**
413402
* @brief Checks if a type string is a valid 4-character box type.
414403
* @param type Pointer to type string.

0 commit comments

Comments
 (0)