File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,10 @@ - (void)setAsset:(AVAsset *)asset
277
277
{
278
278
ASDN::MutexLocker l (_videoLock);
279
279
280
- if (ASObjectIsEqual (((AVURLAsset *)asset).URL , ((AVURLAsset *)_asset).URL )) {
280
+ if (ASObjectIsEqual (asset, _asset)
281
+ || ([asset isKindOfClass: [AVURLAsset class ]]
282
+ && [_asset isKindOfClass: [AVURLAsset class ]]
283
+ && ASObjectIsEqual (((AVURLAsset *)asset).URL , ((AVURLAsset *)_asset).URL ))) {
281
284
return ;
282
285
}
283
286
Original file line number Diff line number Diff line change 13
13
@interface ASVideoNodeTests : XCTestCase
14
14
{
15
15
ASVideoNode *_videoNode;
16
- AVAsset *_firstAsset;
16
+ AVURLAsset *_firstAsset;
17
17
AVAsset *_secondAsset;
18
18
}
19
19
@end
@@ -43,7 +43,7 @@ @implementation ASVideoNodeTests
43
43
- (void )setUp
44
44
{
45
45
_videoNode = [[ASVideoNode alloc ] init ];
46
- _firstAsset = [AVAsset assetWithURL: [NSURL URLWithString: @" firstURL" ]];
46
+ _firstAsset = [AVURLAsset assetWithURL: [NSURL URLWithString: @" firstURL" ]];
47
47
_secondAsset = [AVAsset assetWithURL: [NSURL URLWithString: @" secondURL" ]];
48
48
}
49
49
@@ -67,7 +67,7 @@ - (void)testVideoNodeDoesNotReplaceAVPlayerItemWhenSameURLIsSet
67
67
_videoNode.asset = _firstAsset;
68
68
AVPlayerItem *item = [_videoNode currentItem ];
69
69
70
- _videoNode.asset = _firstAsset;
70
+ _videoNode.asset = [AVAsset assetWithURL: _firstAsset.URL] ;
71
71
AVPlayerItem *secondItem = [_videoNode currentItem ];
72
72
73
73
XCTAssertEqualObjects (item, secondItem);
You can’t perform that action at this time.
0 commit comments