Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/BradLarson/GPUImage
Browse files Browse the repository at this point in the history
# By Alexander Edge
# Via Alexander Edge (1) and Brad Larson (1)
* 'master' of https://github.com/BradLarson/GPUImage:
  Prevent main (UI) thread freezing on repeat
  • Loading branch information
brandonscript committed Nov 30, 2014
2 parents 9fd6e0f + b228793 commit 222f8b0
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions framework/Source/GPUImageMovie.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,17 @@ - (void)startProcessing
GPUImageMovie __block *blockSelf = self;

[inputAsset loadValuesAsynchronouslyForKeys:[NSArray arrayWithObject:@"tracks"] completionHandler: ^{
NSError *error = nil;
AVKeyValueStatus tracksStatus = [inputAsset statusOfValueForKey:@"tracks" error:&error];
if (tracksStatus != AVKeyValueStatusLoaded)
{
return;
}
blockSelf.asset = inputAsset;
[blockSelf processAsset];
blockSelf = nil;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSError *error = nil;
AVKeyValueStatus tracksStatus = [inputAsset statusOfValueForKey:@"tracks" error:&error];
if (tracksStatus != AVKeyValueStatusLoaded)
{
return;
}
blockSelf.asset = inputAsset;
[blockSelf processAsset];
blockSelf = nil;
});
}];
}

Expand Down

0 comments on commit 222f8b0

Please sign in to comment.