From a0a8c3b56f32e58f53385a8568d1d53ea021ea90 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Thu, 27 Mar 2014 11:13:53 +0100 Subject: [PATCH] Fixed an issue with a negative initial presetantion output timestamp. --- MP42/MP42AVFImporter.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MP42/MP42AVFImporter.m b/MP42/MP42AVFImporter.m index bb6d805..a95add8 100644 --- a/MP42/MP42AVFImporter.m +++ b/MP42/MP42AVFImporter.m @@ -686,7 +686,9 @@ if (type) helper->edits[helper->editsCount].start.value = -1; - helper->editsCount++; + if (helper->edits[helper->editsCount].duration.value > 0) { + helper->editsCount++; + } helper->editOpen = NO; } @@ -765,7 +767,7 @@ } // Check for the initial empty edit - if (demuxHelper->currentTime == 0 && presentationOutputTimeStamp.value != 0) { + if (demuxHelper->currentTime == 0 && presentationOutputTimeStamp.value > 0) { CMTime time = CMTimeConvertScale(presentationOutputTimeStamp, duration.timescale, kCMTimeRoundingMethod_Default); [self endEditListAtTime:time empty:YES helper:demuxHelper]; [self startEditListAtTime:time helper:demuxHelper];