rs / SDAVAssetExportSession

AVAssetExportSession drop-in replacement with customizable audio&video settings
MIT License
805 stars 212 forks source link

it Crashed when i export a short audio (1-2 seconds) #36

Open troyzhao opened 9 years ago

troyzhao commented 9 years ago

it seems that the member variable "lastSamplePresentationTime" cause the problem.

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[AVAssetWriter endSessionAtSourceTime:] invalid parameter not satisfying: ((Boolean)(((endTime).flags & (kCMTimeFlags_Valid | kCMTimeFlags_ImpliedValueFlagsMask)) == kCMTimeFlags_Valid))' *\ First throw call stack: ( 0 CoreFoundation 0x0000000107bc0c65 exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010782abb7 objc_exception_throw + 45 2 AVFoundation 0x0000000103f4baed -[AVAssetWriter cancelWriting] + 0 3 LordofRap 0x0000000102f311a2 -[SDAVAssetExportSession finish] + 466 4 LordofRap 0x0000000102f2fbca 68-[SDAVAssetExportSession exportAsynchronouslyWithCompletionHandler:]_block_invoke160 + 362 5 AVFoundation 0x0000000103f5ed2e -[AVAssetWriterInputMediaDataRequester requestMediaDataIfNecessary] + 88 6 libdispatch.dylib 0x000000010849a186 _dispatch_call_block_and_release + 12 7 libdispatch.dylib 0x00000001084b9614 _dispatch_client_callout + 8 8 libdispatch.dylib 0x00000001084a06a7 _dispatch_queue_drain + 2176 9 libdispatch.dylib 0x000000010849fcc0 _dispatch_queue_invoke + 235 10 libdispatch.dylib 0x00000001084a33b9 _dispatch_root_queue_drain + 1359 11 libdispatch.dylib 0x00000001084a4b17 _dispatch_worker_thread3 + 111 12 libsystem_pthread.dylib 0x0000000108826637 _pthread_wqthread + 729 13 libsystem_pthread.dylib 0x000000010882440d start_wqthread + 13 )

troyzhao commented 9 years ago

ps: it works well in the old version