Skip to content
Browse files

Slideshow check picture path on picture loaded.

  • Loading branch information...
1 parent afa7c02 commit 95f62bd896380f031dda5cd35de06c56d7d70e92 @ulion committed Apr 9, 2013
Showing with 8 additions and 5 deletions.
  1. +7 −4 xbmc/pictures/GUIWindowSlideShow.cpp
  2. +1 −1 xbmc/pictures/GUIWindowSlideShow.h
View
11 xbmc/pictures/GUIWindowSlideShow.cpp
@@ -121,7 +121,7 @@ void CBackgroundPicLoader::Process()
bFullSize = true;
}
}
- m_pCallback->OnLoadPic(m_iPic, m_iSlideNumber, texture, bFullSize);
+ m_pCallback->OnLoadPic(m_iPic, m_iSlideNumber, m_strFileName, texture, bFullSize);
m_isLoading = false;
}
}
@@ -1067,18 +1067,18 @@ bool CGUIWindowSlideShow::PlayVideo()
return false;
}
-void CGUIWindowSlideShow::OnLoadPic(int iPic, int iSlideNumber, CBaseTexture* pTexture, bool bFullSize)
+void CGUIWindowSlideShow::OnLoadPic(int iPic, int iSlideNumber, const CStdString &strFileName, CBaseTexture* pTexture, bool bFullSize)
{
if (pTexture)
{
// set the pic's texture + size etc.
CSingleLock lock(m_slideSection);
- if (iSlideNumber >= m_slides->Size())
+ if (iSlideNumber >= m_slides->Size() || GetPicturePath(m_slides->Get(iSlideNumber).get()) != strFileName)
{ // throw this away - we must have cleared the slideshow while we were still loading
delete pTexture;
return;
}
- CLog::Log(LOGDEBUG, "Finished background loading %s", m_slides->Get(iSlideNumber)->GetPath().c_str());
+ CLog::Log(LOGDEBUG, "Finished background loading slot %d, %d: %s", iPic, iSlideNumber, m_slides->Get(iSlideNumber)->GetPath().c_str());
if (m_bReloadImage)
{
if (m_Image[m_iCurrentPic].IsLoaded() && m_Image[m_iCurrentPic].SlideNumber() != iSlideNumber)
@@ -1111,6 +1111,9 @@ void CGUIWindowSlideShow::OnLoadPic(int iPic, int iSlideNumber, CBaseTexture* pT
}
}
}
+ else if (iSlideNumber >= m_slides->Size() || GetPicturePath(m_slides->Get(iSlideNumber).get()) != strFileName)
+ { // Failed to load image. and not match values calling LoadPic, then something is changed, ignore.
+ }
else
{ // Failed to load image. What should be done??
// We should wait for the current pic to finish rendering, then transistion it out,
View
2 xbmc/pictures/GUIWindowSlideShow.h
@@ -89,7 +89,7 @@ class CGUIWindowSlideShow : public CGUIWindow
virtual void Render();
virtual void Process(unsigned int currentTime, CDirtyRegionList &regions);
virtual void OnDeinitWindow(int nextWindowID);
- void OnLoadPic(int iPic, int iSlideNumber, CBaseTexture* pTexture, bool bFullSize);
+ void OnLoadPic(int iPic, int iSlideNumber, const CStdString &strFileName, CBaseTexture* pTexture, bool bFullSize);
int NumSlides() const;
int CurrentSlide() const;
void Shuffle();

0 comments on commit 95f62bd

Please sign in to comment.
Something went wrong with that request. Please try again.