Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[[ Bug 22650 ]] Fix crash on iOS player
This patch fixes a crash/freeze when repeatedly setting the same filename
in an iOS player.
  • Loading branch information
livecodepanos committed Jan 26, 2021
commit 92456496687c4797acf4382f1cc48e28e0341f7e
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