aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/player/Control.cxx17
-rw-r--r--src/player/Control.hxx2
2 files changed, 14 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);
diff --git a/src/player/Control.hxx b/src/player/Control.hxx
index 021f6ddd9..812f4d621 100644
--- a/src/player/Control.hxx
+++ b/src/player/Control.hxx
@@ -427,6 +427,8 @@ private:
SynchronousCommand(PlayerCommand::QUEUE);
}
+ void SeekLocked(DetachedSong *song, SongTime t);
+
public:
/**
* @param song the song to be queued; the given instance will be owned