Permalink
Browse files

bugfix: play first part of iso stack

  • Loading branch information...
1 parent 2a3f091 commit 662488667f9cf6002eb6c6d4a777d9e002fa4dbb @fetzerch committed Sep 2, 2012
Showing with 17 additions and 8 deletions.
  1. +15 −6 xbmc/Application.cpp
  2. +2 −2 xbmc/FileItem.cpp
View
@@ -3808,14 +3808,23 @@ bool CApplication::PlayStack(const CFileItem& item, bool bRestart)
CLog::Log(LOGERROR, "%s - Cannot open VideoDatabase", __FUNCTION__);
}
- // set startoffset in movieitem, track stack item for updating purposes, and finally play disc part
- if (selectedFile > 0 && selectedFile <= (int)movieList.Size())
+ // make sure that the selected part is within the boundaries
+ if (selectedFile <= 0)
+ {
+ CLog::Log(LOGWARNING, "%s - Selected part %d out of range, playing part 1", __FUNCTION__, selectedFile);
+ selectedFile = 1;
+ }
+ else if (selectedFile > movieList.Size())
{
- movieList[selectedFile - 1]->m_lStartOffset = startoffset > 0 ? STARTOFFSET_RESUME : 0;
- movieList[selectedFile - 1]->SetProperty("stackFileItemToUpdate", true);
- *m_stackFileItemToUpdate = item;
- return PlayFile(*(movieList[selectedFile - 1]));
+ CLog::Log(LOGWARNING, "%s - Selected part %d out of range, playing part %d", __FUNCTION__, selectedFile, movieList.Size());
+ selectedFile = movieList.Size();
}
+
+ // set startoffset in movieitem, track stack item for updating purposes, and finally play disc part
+ movieList[selectedFile - 1]->m_lStartOffset = startoffset > 0 ? STARTOFFSET_RESUME : 0;
+ movieList[selectedFile - 1]->SetProperty("stackFileItemToUpdate", true);
+ *m_stackFileItemToUpdate = item;
+ return PlayFile(*(movieList[selectedFile - 1]));
}
// case 2: all other stacks
else
View
@@ -69,7 +69,7 @@ CFileItem::CFileItem(const CSong& song)
m_strPath = song.strFileName;
GetMusicInfoTag()->SetSong(song);
m_lStartOffset = song.iStartOffset;
- m_lStartPartNumber = 0;
+ m_lStartPartNumber = 1;
SetProperty("item_start", song.iStartOffset);
m_lEndOffset = song.iEndOffset;
m_strThumbnailImage = song.strThumb;
@@ -325,7 +325,7 @@ void CFileItem::Reset()
m_dateTime.Reset();
m_iDriveType = CMediaSource::SOURCE_TYPE_UNKNOWN;
m_lStartOffset = 0;
- m_lStartPartNumber = 0;
+ m_lStartPartNumber = 1;
m_lEndOffset = 0;
m_iprogramCount = 0;
m_idepth = 1;

0 comments on commit 6624886

Please sign in to comment.