Skip to content

Commit

Permalink
Merge pull request xbmc#1356 from fetzerch/bugfix-isostack
Browse files Browse the repository at this point in the history
bugfix: fixed initial playback of stacked iso images
  • Loading branch information
MartijnKaijser committed Sep 8, 2012
2 parents f204d9b + 6624886 commit fabf961
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 15 additions & 6 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3891,14 +3891,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
Expand Down
4 changes: 2 additions & 2 deletions xbmc/FileItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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;
Expand Down Expand Up @@ -566,7 +566,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;
Expand Down

0 comments on commit fabf961

Please sign in to comment.