player/Control: move code to SeekLocked()

This commit is contained in:
Max Kellermann 2015-11-11 16:56:24 +01:00
parent 36239895bd
commit bedd5f00f8
2 changed files with 14 additions and 5 deletions

View File

@ -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);

View File

@ -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