From eb74edd08bfa892cf0f0a2961ebd3baa9389c0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 21 Apr 2010 09:56:00 +0000 Subject: [PATCH] * 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 --- src/apps/mediaplayer/ControllerView.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/apps/mediaplayer/ControllerView.cpp b/src/apps/mediaplayer/ControllerView.cpp index 30df217003..6dc2a25d3c 100644 --- a/src/apps/mediaplayer/ControllerView.cpp +++ b/src/apps/mediaplayer/ControllerView.cpp @@ -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(); }