Fix video track selection in all places

This commit is contained in:
Ilya Laktyushin 2022-03-01 19:17:00 +04:00
parent 552c518f36
commit 67ab9a84fb
2 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@
return [_originalAsset originalSize];
}
AVAssetTrack *track = _cachedAVAsset.tracks.firstObject;
AVAssetTrack *track = [_cachedAVAsset tracksWithMediaType:AVMediaTypeVideo].firstObject;
_cachedSize = CGRectApplyAffineTransform((CGRect){ CGPointZero, track.naturalSize }, track.preferredTransform).size;
return _cachedSize;
}

View File

@ -457,7 +457,7 @@
{
return [[SSignal alloc] initWithGenerator:^id<SDisposable>(SSubscriber *subscriber)
{
AVAssetTrack *track = avAsset.tracks.firstObject;
AVAssetTrack *track = [avAsset tracksWithMediaType:AVMediaTypeVideo].firstObject;
if (track == nil)
{
[subscriber putError:nil];