mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-08 13:42:51 +00:00
Check the AVAsset's type before casting to an AVURLAsset
This commit is contained in:
parent
a3576d5d61
commit
cb1579e8af
@ -277,7 +277,10 @@
|
||||
{
|
||||
ASDN::MutexLocker l(_videoLock);
|
||||
|
||||
if (ASObjectIsEqual(((AVURLAsset *)asset).URL, ((AVURLAsset *)_asset).URL)) {
|
||||
if (ASObjectIsEqual(asset, _asset)
|
||||
|| ([asset isKindOfClass:[AVURLAsset class]]
|
||||
&& [_asset isKindOfClass:[AVURLAsset class]]
|
||||
&& ASObjectIsEqual(((AVURLAsset *)asset).URL, ((AVURLAsset *)_asset).URL))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
@interface ASVideoNodeTests : XCTestCase
|
||||
{
|
||||
ASVideoNode *_videoNode;
|
||||
AVAsset *_firstAsset;
|
||||
AVURLAsset *_firstAsset;
|
||||
AVAsset *_secondAsset;
|
||||
}
|
||||
@end
|
||||
@ -43,7 +43,7 @@
|
||||
- (void)setUp
|
||||
{
|
||||
_videoNode = [[ASVideoNode alloc] init];
|
||||
_firstAsset = [AVAsset assetWithURL:[NSURL URLWithString:@"firstURL"]];
|
||||
_firstAsset = [AVURLAsset assetWithURL:[NSURL URLWithString:@"firstURL"]];
|
||||
_secondAsset = [AVAsset assetWithURL:[NSURL URLWithString:@"secondURL"]];
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
_videoNode.asset = _firstAsset;
|
||||
AVPlayerItem *item = [_videoNode currentItem];
|
||||
|
||||
_videoNode.asset = _firstAsset;
|
||||
_videoNode.asset = [AVAsset assetWithURL:_firstAsset.URL];
|
||||
AVPlayerItem *secondItem = [_videoNode currentItem];
|
||||
|
||||
XCTAssertEqualObjects(item, secondItem);
|
||||
|
Loading…
x
Reference in New Issue
Block a user