diff options
author | Arne Morten Kvarving <cptspiff@gmail.com> | 2014-04-17 00:14:28 +0200 |
---|---|---|
committer | ace20022 <ace20022@ymail.com> | 2015-03-01 22:58:13 +0100 |
commit | 1e987d235c72192336623dc206e75407724b3d98 (patch) | |
tree | c1fe132b7b228a4791374044bf914e9bca68da7e | |
parent | 1e36d5b883de65b665f4ec4954263abf24936a19 (diff) |
added: ability to specify where to extract thumb from in thumb extractor job
-rw-r--r-- | xbmc/video/VideoThumbLoader.cpp | 6 | ||||
-rw-r--r-- | xbmc/video/VideoThumbLoader.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/xbmc/video/VideoThumbLoader.cpp b/xbmc/video/VideoThumbLoader.cpp index 583d9d015f..e93d58bed2 100644 --- a/xbmc/video/VideoThumbLoader.cpp +++ b/xbmc/video/VideoThumbLoader.cpp @@ -50,12 +50,14 @@ using namespace VIDEO; CThumbExtractor::CThumbExtractor(const CFileItem& item, const std::string& listpath, bool thumb, - const std::string& target) + const std::string& target, + int64_t pos) { m_listpath = listpath; m_target = target; m_thumb = thumb; m_item = item; + m_pos = pos; if (item.IsVideoDb() && item.HasVideoInfoTag()) m_item.SetPath(item.GetVideoInfoTag()->m_strFileNameAndPath); @@ -106,7 +108,7 @@ bool CThumbExtractor::DoWork() // construct the thumb cache file CTextureDetails details; details.file = CTextureCache::GetCacheFile(m_target) + ".jpg"; - result = CDVDFileInfo::ExtractThumb(m_item.GetPath(), details, &m_item.GetVideoInfoTag()->m_streamDetails); + result = CDVDFileInfo::ExtractThumb(m_item.GetPath(), details, &m_item.GetVideoInfoTag()->m_streamDetails, (int) m_pos); if(result) { CTextureCache::Get().AddCachedTexture(m_target, details); diff --git a/xbmc/video/VideoThumbLoader.h b/xbmc/video/VideoThumbLoader.h index 55560dad4e..6486c012d3 100644 --- a/xbmc/video/VideoThumbLoader.h +++ b/xbmc/video/VideoThumbLoader.h @@ -38,7 +38,7 @@ class CVideoDatabase; class CThumbExtractor : public CJob { public: - CThumbExtractor(const CFileItem& item, const std::string& listpath, bool thumb, const std::string& strTarget=""); + CThumbExtractor(const CFileItem& item, const std::string& listpath, bool thumb, const std::string& strTarget="", int64_t pos = -1); virtual ~CThumbExtractor(); /*! @@ -57,6 +57,7 @@ public: std::string m_listpath; ///< path used in fileitem list CFileItem m_item; bool m_thumb; ///< extract thumb? + int64_t m_pos; ///< position to extract thumb from }; class CVideoThumbLoader : public CThumbLoader, public CJobQueue |