* When toggling playing, we need to check whether there is a valid current

playlist item - only if there is one, the controller handles this, otherwise
  we start the playlist again from start.
* This fixes bug #5568.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36392 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-04-21 09:56:00 +00:00
parent d75c9c3da5
commit eb74edd08b

View File

@ -97,7 +97,12 @@ ControllerView::EnabledButtons()
void
ControllerView::TogglePlaying()
{
fController->TogglePlaying();
BAutolock _(fPlaylist);
if (fPlaylist->CurrentItemIndex() < 0) {
// No valid playlist item - start again from the first one
fPlaylist->SetCurrentItemIndex(0);
} else
fController->TogglePlaying();
}