aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2022-05-24 16:52:23 +0200
committerKai Sommerfeld <kai.sommerfeld@gmx.com>2022-06-19 18:42:47 +0200
commitdb22c817ebf15191593378f7dc186937db6d067b (patch)
tree66b60bb10ca68aaca6e89e053ddf31028f35cffd
parent2308c3f4013870f539c88fd07aed052fe09f844d (diff)
[videoplayer] Try to resolve the correct mime type of the item in vp worker thread, as this can take some time, for example if the item is located an a slow/unreachable remote location.
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
index 2036757793..02e6b196e3 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
@@ -675,8 +675,6 @@ bool CVideoPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options
m_item = file;
m_playerOptions = options;
- // Try to resolve the correct mime type
- m_item.SetMimeTypeForInternetFile();
m_processInfo->SetPlayTimes(0,0,0,0);
m_bAbortRequest = false;
@@ -1336,6 +1334,11 @@ void CVideoPlayer::Prepare()
void CVideoPlayer::Process()
{
+ // Try to resolve the correct mime type. This can take some time, for example if a requested
+ // item is located at a slow/not reachable remote source. So, do mime type detection in vp worker
+ // thread, not directly when initalizing the player to keep GUI responsible.
+ m_item.SetMimeTypeForInternetFile();
+
CServiceBroker::GetWinSystem()->RegisterRenderLoop(this);
Prepare();