Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resume playback from playlist does not work (trac 13929) #2293

Merged
merged 1 commit into from Feb 26, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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