mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 1076719 - Skip styp box at beginning of new fragment. r=kentuckyfriedtakahe
This commit is contained in:
parent
ea0cd6240f
commit
8660d38868
@ -3569,16 +3569,21 @@ status_t MPEG4Source::fragmentedRead(
|
||||
// move to next fragment
|
||||
off64_t nextMoof = mNextMoofOffset; // lastSample.offset + lastSample.size;
|
||||
|
||||
// If we're pointing to a sidx box then we skip it.
|
||||
// If we're pointing to a segment type or sidx box then we skip them.
|
||||
uint32_t hdr[2];
|
||||
if (mDataSource->readAt(nextMoof, hdr, 8) < 8) {
|
||||
return ERROR_END_OF_STREAM;
|
||||
}
|
||||
uint64_t chunk_size = ntohl(hdr[0]);
|
||||
uint32_t chunk_type = ntohl(hdr[1]);
|
||||
if (chunk_type == FOURCC('s', 'i', 'd', 'x')) {
|
||||
do {
|
||||
if (mDataSource->readAt(nextMoof, hdr, 8) < 8) {
|
||||
return ERROR_END_OF_STREAM;
|
||||
}
|
||||
uint64_t chunk_size = ntohl(hdr[0]);
|
||||
uint32_t chunk_type = ntohl(hdr[1]);
|
||||
|
||||
if (chunk_type != FOURCC('s', 't', 'y', 'p') &&
|
||||
chunk_type != FOURCC('s', 'i', 'd', 'x')) {
|
||||
break;
|
||||
}
|
||||
nextMoof += chunk_size;
|
||||
}
|
||||
} while(true);
|
||||
|
||||
mCurrentMoofOffset = nextMoof;
|
||||
mCurrentSamples.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user