From 67431a3c473b025135008b30078af0ed31053c47 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sun, 11 Nov 2012 16:16:46 +1300 Subject: videodb:// and stack:// items didn't go through the correct checks for playlists etc. before attempting to extract streamdetails/thumbs. fixes #13502 --- xbmc/video/VideoThumbLoader.cpp | 22 ++++++++++------------ xbmc/video/VideoThumbLoader.h | 1 - 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/xbmc/video/VideoThumbLoader.cpp b/xbmc/video/VideoThumbLoader.cpp index 81d25e07cb..731d1c4646 100644 --- a/xbmc/video/VideoThumbLoader.cpp +++ b/xbmc/video/VideoThumbLoader.cpp @@ -47,13 +47,11 @@ CThumbExtractor::CThumbExtractor(const CFileItem& item, const CStdString& listpa m_thumb = thumb; m_item = item; - m_path = item.GetPath(); - if (item.IsVideoDb() && item.HasVideoInfoTag()) - m_path = item.GetVideoInfoTag()->m_strFileNameAndPath; + m_item.SetPath(item.GetVideoInfoTag()->m_strFileNameAndPath); - if (URIUtils::IsStack(m_path)) - m_path = CStackDirectory::GetFirstStackedFile(m_path); + if (m_item.IsStack()) + m_item.SetPath(CStackDirectory::GetFirstStackedFile(m_item.GetPath())); } CThumbExtractor::~CThumbExtractor() @@ -73,9 +71,9 @@ bool CThumbExtractor::operator==(const CJob* job) const bool CThumbExtractor::DoWork() { - if (URIUtils::IsLiveTV(m_path) - || URIUtils::IsUPnP(m_path) - || URIUtils::IsDAAP(m_path) + if (m_item.IsLiveTV() + || URIUtils::IsUPnP(m_item.GetPath()) + || m_item.IsDAAP() || m_item.IsDVD() || m_item.IsDVDImage() || m_item.IsDVDFile(false, true) @@ -84,17 +82,17 @@ bool CThumbExtractor::DoWork() || m_item.IsPlayList()) return false; - if (URIUtils::IsRemote(m_path) && !URIUtils::IsOnLAN(m_path)) + if (URIUtils::IsRemote(m_item.GetPath()) && !URIUtils::IsOnLAN(m_item.GetPath())) return false; bool result=false; if (m_thumb) { - CLog::Log(LOGDEBUG,"%s - trying to extract thumb from video file %s", __FUNCTION__, m_path.c_str()); + CLog::Log(LOGDEBUG,"%s - trying to extract thumb from video file %s", __FUNCTION__, m_item.GetPath().c_str()); // construct the thumb cache file CTextureDetails details; details.file = CTextureCache::GetCacheFile(m_target) + ".jpg"; - result = CDVDFileInfo::ExtractThumb(m_path, details, &m_item.GetVideoInfoTag()->m_streamDetails); + result = CDVDFileInfo::ExtractThumb(m_item.GetPath(), details, &m_item.GetVideoInfoTag()->m_streamDetails); if(result) { CTextureCache::Get().AddCachedTexture(m_target, details); @@ -105,7 +103,7 @@ bool CThumbExtractor::DoWork() } else if (m_item.HasVideoInfoTag() && !m_item.GetVideoInfoTag()->HasStreamDetails()) { - CLog::Log(LOGDEBUG,"%s - trying to extract filestream details from video file %s", __FUNCTION__, m_path.c_str()); + CLog::Log(LOGDEBUG,"%s - trying to extract filestream details from video file %s", __FUNCTION__, m_item.GetPath().c_str()); result = CDVDFileInfo::GetFileStreamDetails(&m_item); } diff --git a/xbmc/video/VideoThumbLoader.h b/xbmc/video/VideoThumbLoader.h index ce99ad9112..9ea86fc898 100644 --- a/xbmc/video/VideoThumbLoader.h +++ b/xbmc/video/VideoThumbLoader.h @@ -56,7 +56,6 @@ public: virtual bool operator==(const CJob* job) const; - CStdString m_path; ///< path of video to extract thumb from CStdString m_target; ///< thumbpath CStdString m_listpath; ///< path used in fileitem list CFileItem m_item; -- cgit v1.2.3