Move the offset calculation to MP42EditListsReconstructor

This commit is contained in:
Damiano Galassi committed 2017-09-12 11:30:58 +02:00
1 parent 9f7089b831
commit 876d1f2562
3 files changed
+15 -10

No files matched your search

+6
View File
@@ -34,6 +34,8 @@
_priorityQueue = [[MP42Heap alloc] initWithCapacity:32 comparator:^NSComparisonResult(MP42SampleBuffer * obj1, MP42SampleBuffer * obj2) {
return obj2->presentationTimestamp - obj1->presentationTimestamp;
}];
_minOffset = INT64_MAX;
}
return self;
@@ -105,6 +107,10 @@
// Re-align things if the first sample pts is not 0
_currentMediaTime = sample->presentationTimestamp;
}
if (sample->offset < _minOffset) {
_minOffset = sample->offset;
}
#ifdef AVF_DEBUG
NSLog(@"T: %llu, D: %lld, P: %lld, PO: %lld O: %lld", _currentMediaTime, sample->decodeTimestamp, sample->presentationTimestamp, sample->presentationOutputTimestamp, sample->offset);