Skip to content

Instantly share code, notes, and snippets.

@zoul
Created November 8, 2010 08:35
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoul/667480 to your computer and use it in GitHub Desktop.
Save zoul/667480 to your computer and use it in GitHub Desktop.
Export assets synchronously. Good for testing.
@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
@f-ewald
Copy link

f-ewald commented Feb 9, 2015

dispatch_release doesn't work with ARC. I prefer using NSNotificationCenter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment