diff options
-rw-r--r-- | addons/resource.language.en_gb/resources/strings.po | 3 | ||||
-rw-r--r-- | xbmc/application/Application.cpp | 2 | ||||
-rw-r--r-- | xbmc/dialogs/GUIDialogSimpleMenu.cpp | 16 | ||||
-rw-r--r-- | xbmc/platform/win32/network/NetworkWin32.cpp | 21 | ||||
-rw-r--r-- | xbmc/windows/GUIMediaWindow.cpp | 18 |
5 files changed, 27 insertions, 33 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index 162bd67ca1..e72dc01c99 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -7289,6 +7289,9 @@ msgctxt "#13423" msgid "Remember for this path" msgstr "" +#. Shown on context menu when a bluray:// or dvd:// playlist has already been saved +#. Giving the user a chance to select a new one via the simple menu dialog +#: xbmc/video/windows/GUIWindowVideoBase.cpp msgctxt "#13424" msgid "Choose playlist" msgstr "" diff --git a/xbmc/application/Application.cpp b/xbmc/application/Application.cpp index 6046d2d82e..baa561879c 100644 --- a/xbmc/application/Application.cpp +++ b/xbmc/application/Application.cpp @@ -2438,7 +2438,7 @@ bool CApplication::PlayFile(CFileItem item, // a disc image might be Blu-Ray disc if (!(options.startpercent > 0.0 || options.starttime > 0.0) && (VIDEO::IsBDFile(item) || item.IsDiscImage() || - (VIDEO::IsBlurayPlaylist(item) && forceSelection))) + (forceSelection && VIDEO::IsBlurayPlaylist(item)))) { // No video selection when using external or remote players (they handle it if supported) const bool isSimpleMenuAllowed = [&]() diff --git a/xbmc/dialogs/GUIDialogSimpleMenu.cpp b/xbmc/dialogs/GUIDialogSimpleMenu.cpp index 2049e2615c..fed153fb16 100644 --- a/xbmc/dialogs/GUIDialogSimpleMenu.cpp +++ b/xbmc/dialogs/GUIDialogSimpleMenu.cpp @@ -29,8 +29,6 @@ #include "video/VideoFileItemClassify.h" #include "video/VideoInfoTag.h" -std::string m_savePath; - using namespace KODI; namespace @@ -59,10 +57,9 @@ bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item, bool forceSelectio if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_DISC_PLAYBACK) != BD_PLAYBACK_SIMPLE_MENU) return true; - m_savePath = ""; - if (VIDEO::IsBlurayPlaylist(item) && forceSelection) + if (forceSelection && VIDEO::IsBlurayPlaylist(item)) { - m_savePath = item.GetDynPath(); // save for screen refresh later + item.SetProperty("save_dyn_path", item.GetDynPath()); // save for screen refresh later item.SetDynPath(item.GetBlurayPath()); } @@ -135,11 +132,14 @@ bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item, const std::string& if (item_new->m_bIsFolder == false) { - if (m_savePath.empty()) // If not set above (choose playlist selected) - m_savePath = item.GetDynPath(); + std::string path; + if (item.HasProperty("save_dyn_path")) + path = item.GetProperty("save_dyn_path").asString(); + else + path = item.GetDynPath(); // If not set above (choose playlist selected) item.SetDynPath(item_new->GetDynPath()); item.SetProperty("get_stream_details_from_player", true); - item.SetProperty("original_listitem_url", m_savePath); + item.SetProperty("original_listitem_url", path); return true; } diff --git a/xbmc/platform/win32/network/NetworkWin32.cpp b/xbmc/platform/win32/network/NetworkWin32.cpp index f87056134b..2dee878a9d 100644 --- a/xbmc/platform/win32/network/NetworkWin32.cpp +++ b/xbmc/platform/win32/network/NetworkWin32.cpp @@ -248,7 +248,7 @@ bool CNetworkWin32::PingHost(const struct sockaddr& host, unsigned int timeout_m bool CNetworkInterfaceWin32::GetHostMacAddress(unsigned long host, std::string& mac) const { - struct sockaddr sockHost; + sockaddr sockHost{}; sockHost.sa_family = AF_INET; reinterpret_cast<struct sockaddr_in&>(sockHost).sin_addr.S_un.S_addr = host; return GetHostMacAddress(&sockHost, mac); @@ -260,33 +260,38 @@ bool CNetworkInterfaceWin32::GetHostMacAddress(struct sockaddr* host, std::strin if (GetBestInterfaceEx(host, &InterfaceIndex) != NO_ERROR) return false; - NET_LUID luid = {}; + NET_LUID luid{}; if (ConvertInterfaceIndexToLuid(InterfaceIndex, &luid) != NO_ERROR) return false; - MIB_IPNET_ROW2 neighborIp = {}; + MIB_IPNET_ROW2 neighborIp{}; neighborIp.InterfaceLuid = luid; - neighborIp.InterfaceIndex; - neighborIp.Address.si_family = host->sa_family; switch (host->sa_family) { case AF_INET: - neighborIp.Address.Ipv4 = reinterpret_cast<const struct sockaddr_in&>(host); + memcpy(&neighborIp.Address.Ipv4, host, sizeof(sockaddr_in)); break; case AF_INET6: - neighborIp.Address.Ipv6 = reinterpret_cast<const struct sockaddr_in6&>(host); + memcpy(&neighborIp.Address.Ipv6, host, sizeof(sockaddr_in6)); break; default: return false; } - DWORD dwRetVal = ResolveIpNetEntry2(&neighborIp, nullptr); + DWORD dwRetVal = GetIpNetEntry2(&neighborIp); + + if (dwRetVal != NO_ERROR) + { + CLog::LogF(LOGDEBUG, "Host not found in the cache (error {}), resolve the address.", dwRetVal); + dwRetVal = ResolveIpNetEntry2(&neighborIp, nullptr); + } if (dwRetVal != NO_ERROR) { CLog::LogF(LOGERROR, "ResolveIpNetEntry2 failed with error ({})", dwRetVal); return false; } + if (neighborIp.PhysicalAddressLength < MAC_LENGTH) { CLog::LogF(LOGERROR, diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp index 4e6464e48e..62cf70e6d0 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp @@ -60,12 +60,8 @@ #include "utils/URIUtils.h" #include "utils/Variant.h" #include "utils/log.h" -#include "video/VideoFileItemClassify.h" -#include "video/VideoInfoTag.h" #include "view/GUIViewState.h" -#include <inttypes.h> - #define CONTROL_BTNVIEWASICONS 2 #define CONTROL_BTNSORTBY 3 #define CONTROL_BTNSORTASC 4 @@ -1537,21 +1533,11 @@ bool CGUIMediaWindow::OnPlayAndQueueMedia(const CFileItemPtr& item, const std::s { return i->IsZIP() || i->IsRAR() || i->m_bIsFolder; }), playlist.end()); - // Remove duplicates (eg. ISO/VIDEO_TS) - playlist.erase( - std::unique(playlist.begin(), playlist.end(), - [](const std::shared_ptr<CFileItem>& i, const std::shared_ptr<CFileItem>& j) { - return i->GetVideoInfoTag()->m_basePath == j->GetVideoInfoTag()->m_basePath; - }), - playlist.end()); - // Chosen item int mediaToPlay = std::distance(playlist.begin(), std::find_if(playlist.begin(), playlist.end(), - [&item](const std::shared_ptr<CFileItem>& i) { - return i->GetVideoInfoTag()->m_basePath == - item->GetVideoInfoTag()->m_basePath; - })); + [&item](const std::shared_ptr<CFileItem>& i) + { return i->GetPath() == item->GetPath(); })); // Add to playlist CServiceBroker::GetPlaylistPlayer().ClearPlaylist(playlistId); |