Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 9245649

Browse files
committed
[[ Bug 22650 ]] Fix crash on iOS player
This patch fixes a crash/freeze when repeatedly setting the same filename in an iOS player.
1 parent fe4853d commit 9245649

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

engine/src/mbliphoneplayer.mm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,15 @@ - (void)setPlayer:(AVPlayer *)player
13441344

13451345
- (void)setCurrentItem:(AVPlayerItem *)item
13461346
{
1347-
if (item == m_player_item)
1347+
AVURLAsset *t_existing_asset;
1348+
if (m_player_item != nil)
1349+
t_existing_asset = (AVURLAsset *)m_player_item.asset;
1350+
else
1351+
t_existing_asset = nil;
1352+
1353+
AVURLAsset *t_new_asset = (AVURLAsset *)item.asset;
1354+
1355+
if ([t_existing_asset.URL isEqual: t_new_asset.URL])
13481356
return;
13491357

13501358
if (m_player_item != nil)

0 commit comments

Comments
 (0)