Fix 'Invalid number value (NaN) in JSON write' crash

This commit is contained in:
Baris Sencan 2015-06-17 22:08:01 -07:00
parent 3ac8d2e74a
commit 0927cee27b

View File

@ -96,9 +96,12 @@ static NSString *const statusKeyPath = @"status";
*stop = YES;
}
}];
return [NSNumber numberWithFloat:CMTimeGetSeconds(CMTimeRangeGetEnd(effectiveTimeRange))];
Float64 playableDuration = CMTimeGetSeconds(CMTimeRangeGetEnd(effectiveTimeRange));
if (playableDuration > 0) {
return [NSNumber numberWithFloat:playableDuration];
}
}
return [NSNumber numberWithFloat:CMTimeGetSeconds(kCMTimeInvalid)];
return [NSNumber numberWithInteger:0];
}
- (void)stopProgressTimer