aboutsummaryrefslogtreecommitdiffstats
path: root/src/player/Control.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-11-11 16:56:24 +0100
committerMax Kellermann <max@duempel.org>2015-11-11 16:56:24 +0100
commitbedd5f00f86830b07d8a0649a66112840e6edf35 (patch)
tree48bcce65ab87b4bcf2ecb3b262529892c2347269 /src/player/Control.cxx
parent36239895bd822d5fd3087218fbb10986430b8c9b (diff)
downloadmpd-bedd5f00f86830b07d8a0649a66112840e6edf35.tar.gz
mpd-bedd5f00f86830b07d8a0649a66112840e6edf35.tar.xz
mpd-bedd5f00f86830b07d8a0649a66112840e6edf35.zip
player/Control: move code to SeekLocked()
Diffstat (limited to 'src/player/Control.cxx')
-rw-r--r--src/player/Control.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/player/Control.cxx b/src/player/Control.cxx
index 2e90f7eef..830dd146d 100644
--- a/src/player/Control.cxx
+++ b/src/player/Control.cxx
@@ -220,13 +220,11 @@ PlayerControl::LockEnqueueSong(DetachedSong *song)
Unlock();
}
-bool
-PlayerControl::LockSeek(DetachedSong *song, SongTime t)
+void
+PlayerControl::SeekLocked(DetachedSong *song, SongTime t)
{
assert(song != nullptr);
- Lock();
-
if (next_song != nullptr)
SynchronousCommand(PlayerCommand::CANCEL);
@@ -235,9 +233,18 @@ PlayerControl::LockSeek(DetachedSong *song, SongTime t)
next_song = song;
seek_time = t;
SynchronousCommand(PlayerCommand::SEEK);
- Unlock();
assert(next_song == nullptr);
+}
+
+bool
+PlayerControl::LockSeek(DetachedSong *song, SongTime t)
+{
+ assert(song != nullptr);
+
+ Lock();
+ SeekLocked(song, t);
+ Unlock();
idle_add(IDLE_PLAYER);