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

Commit

Permalink
[[ Bug 22650 ]] Fix crash on iOS player
Browse files Browse the repository at this point in the history
This patch fixes a crash/freeze when repeatedly setting the same filename
in an iOS player.
  • Loading branch information
livecodepanos committed Jan 26, 2021
1 parent fe4853d commit 9245649
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion engine/src/mbliphoneplayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,15 @@ - (void)setPlayer:(AVPlayer *)player

- (void)setCurrentItem:(AVPlayerItem *)item
{
if (item == m_player_item)
AVURLAsset *t_existing_asset;
if (m_player_item != nil)
t_existing_asset = (AVURLAsset *)m_player_item.asset;
else
t_existing_asset = nil;

AVURLAsset *t_new_asset = (AVURLAsset *)item.asset;

if ([t_existing_asset.URL isEqual: t_new_asset.URL])
return;

if (m_player_item != nil)
Expand Down

0 comments on commit 9245649

Please sign in to comment.