Backported various little edits from Pro edition.

This commit is contained in:
Thulinma 2016-05-30 15:17:54 +02:00
parent ef9938da0c
commit 4c9c6fa7ba
78 changed files with 2334 additions and 1266 deletions

View file

@ -1091,10 +1091,15 @@ namespace MP4 {
return;
}
}
memset(data + payloadOffset + 4, 0, 4);
memcpy(data + payloadOffset + 4, newMinorVersion, 4);
}
std::string FTYP::getMinorVersion() {
static char zero[4] = {0,0,0,0};
if (memcmp(zero, data+payloadOffset+4, 4) == 0){
return "";
}
return std::string(data + payloadOffset + 4, 4);
}
@ -2335,7 +2340,8 @@ namespace MP4 {
setEntryCount(no + 1);
}
setInt32(newCTTSEntry.sampleCount, 8 + no * 8);
setInt32(newCTTSEntry.sampleOffset, 8 + (no * 8) + 4);
setInt32(*(reinterpret_cast<uint32_t*>(&newCTTSEntry.sampleOffset)), 8 + (no * 8) + 4);
}
CTTSEntry CTTS::getCTTSEntry(uint32_t no) {
@ -2345,7 +2351,8 @@ namespace MP4 {
return inval;
}
retval.sampleCount = getInt32(8 + (no * 8));
retval.sampleOffset = getInt32(8 + (no * 8) + 4);
uint32_t tmp = getInt32(8 + (no * 8) + 4);
retval.sampleOffset = *(reinterpret_cast<int32_t*>(&tmp));
return retval;
}