diff options
author | Dave Blake <oak99sky@yahoo.co.uk> | 2021-10-24 10:55:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-24 10:55:43 +0100 |
commit | 1191a909970dfe3fa0003255fa629ac80c3e3daa (patch) | |
tree | 09fdbf6a707abf27303aff04ec2624aa890c1bc7 | |
parent | 895972f72316d3c9a6ffb3a98b13b999a0169d3a (diff) | |
parent | 01727e763b0fec1f07b9ec16996d7352dd73ffdb (diff) |
Merge pull request #20252 from arnova/Matrix_airplay_fix
fix: Instead of determining if something is remote, we should determine if it's network
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFile.cpp | 17 | ||||
-rw-r--r-- | xbmc/settings/AdvancedSettings.cpp | 2 | ||||
-rw-r--r-- | xbmc/settings/AdvancedSettings.h | 8 | ||||
-rw-r--r-- | xbmc/utils/URIUtils.cpp | 13 | ||||
-rw-r--r-- | xbmc/utils/URIUtils.h | 1 |
5 files changed, 30 insertions, 11 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFile.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFile.cpp index 044ceeab19..c899cf6552 100644 --- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFile.cpp +++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFile.cpp @@ -53,18 +53,23 @@ bool CDVDInputStreamFile::Open() /* * There are 5 buffer modes available (configurable in as.xml) * 0) Buffer all internet filesystems (like 2 but additionally also ftp, webdav, etc.) (default) - * 1) Buffer all filesystems (including local) + * 1) Buffer all network and local filesystems * 2) Only buffer true internet filesystems (streams) (http, etc.) * 3) No buffer - * 4) Buffer all non-local (remote) filesystems + * 4) Buffer all network filesystems */ if (!URIUtils::IsOnDVD(m_item.GetDynPath()) && !URIUtils::IsBluray(m_item.GetDynPath())) // Never cache these { unsigned int iCacheBufferMode = CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_cacheBufferMode; - if ((iCacheBufferMode == CACHE_BUFFER_MODE_INTERNET && URIUtils::IsInternetStream(m_item.GetDynPath(), true)) - || (iCacheBufferMode == CACHE_BUFFER_MODE_TRUE_INTERNET && URIUtils::IsInternetStream(m_item.GetDynPath(), false)) - || (iCacheBufferMode == CACHE_BUFFER_MODE_REMOTE && URIUtils::IsRemote(m_item.GetDynPath())) - || (iCacheBufferMode == CACHE_BUFFER_MODE_ALL)) + if ((iCacheBufferMode == CACHE_BUFFER_MODE_INTERNET && + URIUtils::IsInternetStream(m_item.GetDynPath(), true)) || + (iCacheBufferMode == CACHE_BUFFER_MODE_TRUE_INTERNET && + URIUtils::IsInternetStream(m_item.GetDynPath(), false)) || + (iCacheBufferMode == CACHE_BUFFER_MODE_NETWORK && + URIUtils::IsNetworkFilesystem(m_item.GetDynPath())) || + (iCacheBufferMode == CACHE_BUFFER_MODE_ALL && + (URIUtils::IsNetworkFilesystem(m_item.GetDynPath()) || + URIUtils::IsHD(m_item.GetDynPath())))) { flags |= READ_CACHED; } diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index 04750bd9c8..1e7aaa8c82 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -378,7 +378,7 @@ void CAdvancedSettings::Initialize() m_PVRDefaultSortOrder.sortOrder = SortOrderDescending; m_cacheMemSize = 1024 * 1024 * 20; // 20 MiB - m_cacheBufferMode = CACHE_BUFFER_MODE_REMOTE; // Default (buffer all remote filesystems) + m_cacheBufferMode = CACHE_BUFFER_MODE_NETWORK; // Default (buffer all network filesystems) m_cacheChunkSize = 128 * 1024; // 128 KiB // the following setting determines the readRate of a player data diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h index 11a6c0201e..2b9dae1301 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -18,11 +18,11 @@ #include <utility> #include <vector> -#define CACHE_BUFFER_MODE_INTERNET 0 -#define CACHE_BUFFER_MODE_ALL 1 +#define CACHE_BUFFER_MODE_INTERNET 0 +#define CACHE_BUFFER_MODE_ALL 1 #define CACHE_BUFFER_MODE_TRUE_INTERNET 2 -#define CACHE_BUFFER_MODE_NONE 3 -#define CACHE_BUFFER_MODE_REMOTE 4 +#define CACHE_BUFFER_MODE_NONE 3 +#define CACHE_BUFFER_MODE_NETWORK 4 class CAppParamParser; class CProfileManager; diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp index 9ee77f4f9f..c52ad8cb24 100644 --- a/xbmc/utils/URIUtils.cpp +++ b/xbmc/utils/URIUtils.cpp @@ -1035,6 +1035,19 @@ bool URIUtils::IsInternetStream(const CURL& url, bool bStrictCheck /* = false */ return false; } +bool URIUtils::IsNetworkFilesystem(const std::string& path) +{ + // Check for "internet" streaming protocols/filesystems + if (IsInternetStream(path, true)) + return true; + + // "Normal" network filesystems + if (IsSmb(path) || IsNfs(path) || IsUPnP(path)) + return true; + + return false; +} + bool URIUtils::IsUPnP(const std::string& strFile) { return IsProtocol(strFile, "upnp"); diff --git a/xbmc/utils/URIUtils.h b/xbmc/utils/URIUtils.h index 8432c949e6..0b1cd035c1 100644 --- a/xbmc/utils/URIUtils.h +++ b/xbmc/utils/URIUtils.h @@ -124,6 +124,7 @@ public: static bool IsInRAR(const std::string& strFile); static bool IsInternetStream(const std::string& path, bool bStrictCheck = false); static bool IsInternetStream(const CURL& url, bool bStrictCheck = false); + static bool IsNetworkFilesystem(const std::string& path); static bool IsInAPK(const std::string& strFile); static bool IsInZIP(const std::string& strFile); static bool IsISO9660(const std::string& strFile); |