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) ...@@ -220,13 +220,11 @@ PlayerControl::LockEnqueueSong(DetachedSong *song)
Unlock(); Unlock();
} }
bool void
PlayerControl::LockSeek(DetachedSong *song, SongTime t) PlayerControl::SeekLocked(DetachedSong *song, SongTime t)
{ {
assert(song != nullptr); assert(song != nullptr);
Lock();
if (next_song != nullptr) if (next_song != nullptr)
SynchronousCommand(PlayerCommand::CANCEL); SynchronousCommand(PlayerCommand::CANCEL);
...@@ -235,9 +233,18 @@ PlayerControl::LockSeek(DetachedSong *song, SongTime t) ...@@ -235,9 +233,18 @@ PlayerControl::LockSeek(DetachedSong *song, SongTime t)
next_song = song; next_song = song;
seek_time = t; seek_time = t;
SynchronousCommand(PlayerCommand::SEEK); SynchronousCommand(PlayerCommand::SEEK);
Unlock();
assert(next_song == nullptr); assert(next_song == nullptr);
}
bool
PlayerControl::LockSeek(DetachedSong *song, SongTime t)
{
assert(song != nullptr);
Lock();
SeekLocked(song, t);
Unlock();
idle_add(IDLE_PLAYER); idle_add(IDLE_PLAYER);
......
...@@ -427,6 +427,8 @@ private: ...@@ -427,6 +427,8 @@ private:
SynchronousCommand(PlayerCommand::QUEUE); SynchronousCommand(PlayerCommand::QUEUE);
} }
void SeekLocked(DetachedSong *song, SongTime t);
public: public:
/** /**
* @param song the song to be queued; the given instance will be owned * @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