Created
November 8, 2010 08:35
-
-
Save zoul/667480 to your computer and use it in GitHub Desktop.
Export assets synchronously. Good for testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation AVAssetExportSession (Testing) | |
- (void) exportSynchronously | |
{ | |
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); | |
[self exportAsynchronouslyWithCompletionHandler:^{ | |
dispatch_semaphore_signal(semaphore); | |
}]; | |
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | |
dispatch_release(semaphore); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dispatch_release
doesn't work with ARC. I prefer using NSNotificationCenter