diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2018-03-16 07:31:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-16 07:31:10 +0100 |
commit | 63fe531e3297579562e33da76ce64fe421278de0 (patch) | |
tree | e2aa612561ea072f08921f5c828c615d1e315669 | |
parent | aedcf10ebc893b7cc00aaddf6f30f161fb8f90cd (diff) | |
parent | 62f697c9859eed011642ea07dffa6aa733580af2 (diff) |
Merge pull request #13648 from FernetMenta/strm
fix playing video strm files with autoplay
-rw-r--r-- | xbmc/FileItem.cpp | 3 | ||||
-rw-r--r-- | xbmc/filesystem/VideoDatabaseDirectory.cpp | 4 | ||||
-rw-r--r-- | xbmc/playlists/PlayList.cpp | 26 | ||||
-rw-r--r-- | xbmc/playlists/PlayListFactory.cpp | 8 |
4 files changed, 34 insertions, 7 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index de93630a94..b694e5d68a 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -993,6 +993,9 @@ bool CFileItem::IsInternetStream(const bool bStrictCheck /* = false */) const if (HasProperty("IsHTTPDirectory")) return false; + if (!m_strDynPath.empty()) + return URIUtils::IsInternetStream(m_strDynPath, bStrictCheck); + return URIUtils::IsInternetStream(m_strPath, bStrictCheck); } diff --git a/xbmc/filesystem/VideoDatabaseDirectory.cpp b/xbmc/filesystem/VideoDatabaseDirectory.cpp index 869c5f288b..96559623b9 100644 --- a/xbmc/filesystem/VideoDatabaseDirectory.cpp +++ b/xbmc/filesystem/VideoDatabaseDirectory.cpp @@ -59,6 +59,10 @@ bool CVideoDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items if (!strImage.empty() && g_TextureManager.HasTexture(strImage)) item->SetIconImage(strImage); } + if (item->GetVideoInfoTag()) + { + item->SetDynPath(item->GetVideoInfoTag()->GetPath()); + } } items.SetLabel(pNode->GetLocalizedName()); diff --git a/xbmc/playlists/PlayList.cpp b/xbmc/playlists/PlayList.cpp index b5b14c9212..5584cc35c8 100644 --- a/xbmc/playlists/PlayList.cpp +++ b/xbmc/playlists/PlayList.cpp @@ -463,23 +463,39 @@ bool CPlayList::Expand(int position) { CFileItemPtr item = m_vecItems[position]; std::unique_ptr<CPlayList> playlist (CPlayListFactory::Create(*item.get())); - if ( NULL == playlist.get()) + if (playlist.get() == nullptr) return false; - if(!playlist->Load(item->GetPath())) + std::string path = item->GetDynPath(); + if (path.empty()) + path = item->GetPath(); + + if (!playlist->Load(path)) return false; // remove any item that points back to itself - for(int i = 0;i<playlist->size();i++) + for (int i = 0;i<playlist->size();i++) { - if(StringUtils::EqualsNoCase((*playlist)[i]->GetPath(), item->GetPath())) + if (StringUtils::EqualsNoCase((*playlist)[i]->GetPath(), path)) { playlist->Remove(i); i--; } } - if(playlist->size() <= 0) + // @todo + // never change original path (id) of a file item + // playlist items should be created with dynPath instead + if (!item->GetDynPath().empty()) + { + for (int i = 0;i<playlist->size();i++) + { + (*playlist)[i]->SetDynPath((*playlist)[i]->GetPath()); + (*playlist)[i]->SetPath(item->GetPath()); + } + } + + if (playlist->size() <= 0) return false; Remove(position); diff --git a/xbmc/playlists/PlayListFactory.cpp b/xbmc/playlists/PlayListFactory.cpp index 46d0227abf..3b721cc5e5 100644 --- a/xbmc/playlists/PlayListFactory.cpp +++ b/xbmc/playlists/PlayListFactory.cpp @@ -38,7 +38,7 @@ CPlayList* CPlayListFactory::Create(const std::string& filename) CPlayList* CPlayListFactory::Create(const CFileItem& item) { - if( item.IsInternetStream() ) + if (item.IsInternetStream()) { // Ensure the MIME type has been retrieved for http:// and shout:// streams if (item.GetMimeType().empty()) @@ -72,7 +72,11 @@ CPlayList* CPlayListFactory::Create(const CFileItem& item) return new CPlayListWPL(); } - std::string extension = URIUtils::GetExtension(item.GetPath()); + std::string path = item.GetDynPath(); + if (path.empty()) + path = item.GetPath(); + + std::string extension = URIUtils::GetExtension(path); StringUtils::ToLower(extension); if (extension == ".m3u" || extension == ".strm") |