Commit bedd5f00 authored by Max Kellermann's avatar Max Kellermann

player/Control: move code to SeekLocked()

parent 36239895
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment