Permalink
Browse files

fix playlist position if CPlayListPlayer::Swap() swaps the currently …

…playing item
  • Loading branch information...
1 parent 3ddd401 commit d187b1c2197c4477ba22f5364a3044cc1be46045 @Montellese Montellese committed Nov 15, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 xbmc/PlayListPlayer.cpp
View
@@ -643,7 +643,13 @@ void CPlayListPlayer::Swap(int iPlaylist, int indexItem1, int indexItem2)
return;
CPlayList& list = GetPlaylist(iPlaylist);
- list.Swap(indexItem1, indexItem2);
+ if (list.Swap(indexItem1, indexItem2) && iPlaylist == m_iCurrentPlayList)
+ {
+ if (m_iCurrentSong == indexItem1)
+ m_iCurrentSong = indexItem2;
+ else if (m_iCurrentSong == indexItem2)
+ m_iCurrentSong = indexItem1;
+ }
// its likely that the playlist changed
CGUIMessage msg(GUI_MSG_PLAYLIST_CHANGED, 0, 0);

0 comments on commit d187b1c

Please sign in to comment.