Write the sgpd/sbgp only when importing tracks, do not write a guessed delay on save on every mp4.

Fixed another crash in avfoundation edit lists code.
This commit is contained in:
Damiano Galassi committed 2017-09-03 11:41:28 +02:00
1 parent adb8735bf4
commit 9f7089b831
8 files changed
+83 -66

No files matched your search

-15
View File
@@ -54,21 +54,6 @@
_channels = c.channels;
free(pAacConfig);
}
if (!MP4HaveTrackAtom(fileHandle, self.trackId, "mdia.minf.stbl.sgpd")) {
BOOL addDelay = YES;
uint32_t edits = MP4GetTrackNumberOfEdits(fileHandle, self.trackId);
if (edits == 1) {
MP4Timestamp startTime = MP4GetTrackEditMediaStart(fileHandle, self.trackId, 1);
if (startTime != 0) {
addDelay = NO;
}
}
if (addDelay) {
// Guess a audio encoder delay
self.startOffset = -2112.f / self.timescale * 1000;
}
}
}
else if ((audioType == MP4_PCM16_LITTLE_ENDIAN_AUDIO_TYPE) ||
(audioType == MP4_PCM16_BIG_ENDIAN_AUDIO_TYPE)) {