aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <3226626+ksooo@users.noreply.github.com>2023-10-15 10:20:46 +0200
committerGitHub <noreply@github.com>2023-10-15 10:20:46 +0200
commit49cf52f515546256a867173f5edfaf474986d95b (patch)
tree277e76f0f7a55562c5cba7739007a60904a68ec8
parent4e5909fa999402a36469d20d2107364bcdb8e0c7 (diff)
parentc2c0ac8661bacb51e9fd76034b58c65f448d5933 (diff)
downloadxbmc-49cf52f515546256a867173f5edfaf474986d95b.tar.xz
Merge pull request #23931 from ksooo/app-fix-bd-select-menu
[application] Fix bd selection menu shown when external player is used.
-rw-r--r--xbmc/application/Application.cpp14
-rw-r--r--xbmc/cores/playercorefactory/PlayerCoreFactory.cpp5
-rw-r--r--xbmc/cores/playercorefactory/PlayerCoreFactory.h1
3 files changed, 17 insertions, 3 deletions
diff --git a/xbmc/application/Application.cpp b/xbmc/application/Application.cpp
index ce5b77c8e8..bf1feb60bf 100644
--- a/xbmc/application/Application.cpp
+++ b/xbmc/application/Application.cpp
@@ -2450,9 +2450,17 @@ bool CApplication::PlayFile(CFileItem item, const std::string& player, bool bRes
if (!(options.startpercent > 0.0 || options.starttime > 0.0) &&
(item.IsBDFile() || item.IsDiscImage()))
{
- //check if we must show the simplified bd menu
- if (!CGUIDialogSimpleMenu::ShowPlaySelection(item))
- return true;
+ // No video selection when using an external player, because it needs to handle that on its own.
+ const std::string defaulPlayer{
+ player.empty() ? m_ServiceManager->GetPlayerCoreFactory().GetDefaultPlayer(item) : player};
+ const bool isExternalPlayer{
+ m_ServiceManager->GetPlayerCoreFactory().IsExternalPlayer(defaulPlayer)};
+ if (!isExternalPlayer)
+ {
+ // Check if we must show the simplified bd menu.
+ if (!CGUIDialogSimpleMenu::ShowPlaySelection(item))
+ return true;
+ }
}
// this really aught to be inside !bRestart, but since PlayStack
diff --git a/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp b/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
index f9ac98b655..8f5d0ccd7f 100644
--- a/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
+++ b/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
@@ -254,6 +254,11 @@ std::string CPlayerCoreFactory::GetPlayerType(const std::string& player) const
return m_vecPlayerConfigs[idx]->m_type;
}
+bool CPlayerCoreFactory::IsExternalPlayer(const std::string& player) const
+{
+ return (GetPlayerType(player) == "external");
+}
+
bool CPlayerCoreFactory::PlaysAudio(const std::string& player) const
{
std::unique_lock<CCriticalSection> lock(m_section);
diff --git a/xbmc/cores/playercorefactory/PlayerCoreFactory.h b/xbmc/cores/playercorefactory/PlayerCoreFactory.h
index e2963e8a36..50f45c624b 100644
--- a/xbmc/cores/playercorefactory/PlayerCoreFactory.h
+++ b/xbmc/cores/playercorefactory/PlayerCoreFactory.h
@@ -44,6 +44,7 @@ public:
void GetPlayers(std::vector<std::string>&players, std::string &type) const;
void GetRemotePlayers(std::vector<std::string>&players) const; //All remote players we can attach to
std::string GetPlayerType(const std::string &player) const;
+ bool IsExternalPlayer(const std::string& player) const;
bool PlaysAudio(const std::string &player) const;
bool PlaysVideo(const std::string &player) const;