Small code cleanup to setFilter

This commit is contained in:
Hampton Maxwell 2018-12-20 10:45:14 -08:00 committed by GitHub
parent c2d9fb4301
commit f401c6a287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1288,17 +1288,13 @@ static int const RCTVideoUnset = -1;
return;
} else if ([[_source objectForKey:@"uri"] rangeOfString:@"m3u8"].location != NSNotFound) {
return; // filters don't work for HLS... return
}
AVAsset *asset = _playerItem.asset;
if (!asset) {
} else if (!_playerItem.asset) {
return;
}
CIFilter *filter = [CIFilter filterWithName:filterName];
_playerItem.videoComposition = [AVVideoComposition
videoCompositionWithAsset:asset
videoCompositionWithAsset:_playerItem.asset
applyingCIFiltersWithHandler:^(AVAsynchronousCIImageFilteringRequest *_Nonnull request) {
if (filter == nil) {
[request finishWithImage:request.sourceImage context:nil];
@ -1475,4 +1471,4 @@ static int const RCTVideoUnset = -1;
return array[0];
}
@end
@end