Skip to content

Commit

Permalink
Fix resume playback from playlist does not work (trac 13929)
Browse files Browse the repository at this point in the history
  • Loading branch information
Voyager1 committed Feb 26, 2013
1 parent 4682843 commit d7b3732
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/PlayListPlayer.cpp
Expand Up @@ -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());
Expand Down
2 changes: 2 additions & 0 deletions xbmc/playlists/PlayList.cpp
Expand Up @@ -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;
}
}
Expand Down
9 changes: 9 additions & 0 deletions xbmc/video/windows/GUIWindowVideoPlaylist.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit d7b3732

Please sign in to comment.