Fix getting stuck using VideoPlayer and breaking game launching #14478
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a game fails to launch, Kodi gets "stuck" using VideoPlayer. After enabling emulators, Kodi should choose RetroPlayer, but continues to use VideoPlayer, which continues to silently fail.
Description
When I launched a game with no emulators enabled, VideoPlayer tried to play the ROM and failed. However, the player core in app player was never reset, so after enabling emulators, Kodi continues trying to use the existing player to play games, which breaks all game launching.
To solve this, we reset the app player core, which allows Kodi to successfully create a new RetroPlayer core.
Motivation and Context
Discovered after deleting AddonDB and having all emulators disabled.
How Has This Been Tested?
Log when launching a game with emulators disabled. Kodi chooses VideoPlayer (fixed by #14480). VideoPlayer tries to open the game and silently fails:
Next, log when enabling emulators and launching a game without this patch. Kodi chooses RetroPlayer, however the existing VideoPlayer tries to open the game and silently fails:
Next, log and screenshot when enabling emulators and launching a game with this patch. RetroPlayer successfully opens the game:
Types of change