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; return;
} else if ([[_source objectForKey:@"uri"] rangeOfString:@"m3u8"].location != NSNotFound) { } else if ([[_source objectForKey:@"uri"] rangeOfString:@"m3u8"].location != NSNotFound) {
return; // filters don't work for HLS... return return; // filters don't work for HLS... return
} } else if (!_playerItem.asset) {
AVAsset *asset = _playerItem.asset;
if (!asset) {
return; return;
} }
CIFilter *filter = [CIFilter filterWithName:filterName]; CIFilter *filter = [CIFilter filterWithName:filterName];
_playerItem.videoComposition = [AVVideoComposition _playerItem.videoComposition = [AVVideoComposition
videoCompositionWithAsset:asset videoCompositionWithAsset:_playerItem.asset
applyingCIFiltersWithHandler:^(AVAsynchronousCIImageFilteringRequest *_Nonnull request) { applyingCIFiltersWithHandler:^(AVAsynchronousCIImageFilteringRequest *_Nonnull request) {
if (filter == nil) { if (filter == nil) {
[request finishWithImage:request.sourceImage context:nil]; [request finishWithImage:request.sourceImage context:nil];