Permalink
Browse files

Merge pull request #2293 from Voyager1/trac_13929

Fix resume playback from playlist does not work (trac 13929)
  • Loading branch information...
2 parents 76470c9 + d7b3732 commit 3ec269eb8aca092e4baee98cadf1d53b77cfb818 @jmarshallnz jmarshallnz committed Feb 26, 2013
Showing with 12 additions and 1 deletion.
  1. +1 −1 xbmc/PlayListPlayer.cpp
  2. +2 −0 xbmc/playlists/PlayList.cpp
  3. +9 −0 xbmc/video/windows/GUIWindowVideoPlaylist.cpp
View
@@ -68,7 +68,7 @@ bool CPlayListPlayer::OnMessage(CGUIMessage &message)
if (message.GetParam1() == GUI_MSG_UPDATE_ITEM && message.GetItem())
{
// update the items in our playlist(s) if necessary
- for (int i = PLAYLIST_MUSIC; i != PLAYLIST_VIDEO; i++)
+ for (int i = PLAYLIST_MUSIC; i <= PLAYLIST_VIDEO; i++)
{
CPlayList &playlist = GetPlaylist(i);
CFileItemPtr item = boost::static_pointer_cast<CFileItem>(message.GetItem());
@@ -490,7 +490,9 @@ void CPlayList::UpdateItem(const CFileItem *item)
CFileItemPtr playlistItem = *it;
if (playlistItem->IsSamePath(item))
{
+ CStdString temp = playlistItem->GetPath(); // save path, it may have been altered
*playlistItem = *item;
+ playlistItem->SetPath(temp);
break;
}
}
@@ -330,6 +330,15 @@ bool CGUIWindowVideoPlaylist::OnPlayMedia(int iItem)
CFileItemPtr pItem = m_vecItems->Get(iItem);
CStdString strPath = pItem->GetPath();
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
+ // need to update Playlist FileItem's startOffset and resumePoint based on GUIWindowVideoPlaylist FileItem
+ if (pItem->m_lStartOffset == STARTOFFSET_RESUME)
+ {
+ CFileItemPtr pPlaylistItem = g_playlistPlayer.GetPlaylist(PLAYLIST_VIDEO)[iItem];
+ pPlaylistItem->m_lStartOffset = pItem->m_lStartOffset;
+ if (pPlaylistItem->HasVideoInfoTag() && pItem->HasVideoInfoTag())
+ pPlaylistItem->GetVideoInfoTag()->m_resumePoint = pItem->GetVideoInfoTag()->m_resumePoint;
+ }
+ // now play item
g_playlistPlayer.Play( iItem );
}
return true;

0 comments on commit 3ec269e

Please sign in to comment.