Merge tag 'v0.21.24'

release v0.21.24
This commit is contained in:
Max Kellermann
2020-06-10 22:58:14 +02:00
16 changed files with 88 additions and 36 deletions

View File

@@ -224,7 +224,8 @@ private:
* Caller must lock the mutex.
*/
void StartDecoder(std::unique_lock<Mutex> &lock,
std::shared_ptr<MusicPipe> pipe) noexcept;
std::shared_ptr<MusicPipe> pipe,
bool initial_seek_essential) noexcept;
/**
* The decoder has acknowledged the "START" command (see
@@ -367,7 +368,8 @@ public:
void
Player::StartDecoder(std::unique_lock<Mutex> &lock,
std::shared_ptr<MusicPipe> _pipe) noexcept
std::shared_ptr<MusicPipe> _pipe,
bool initial_seek_essential) noexcept
{
assert(queued || pc.command == PlayerCommand::SEEK);
assert(pc.next_song != nullptr);
@@ -379,6 +381,7 @@ Player::StartDecoder(std::unique_lock<Mutex> &lock,
dc.Start(lock, std::make_unique<DetachedSong>(*pc.next_song),
start_time, pc.next_song->GetEndTime(),
initial_seek_essential,
buffer, std::move(_pipe));
}
@@ -636,7 +639,7 @@ Player::SeekDecoder(std::unique_lock<Mutex> &lock) noexcept
pipe->Clear();
/* re-start the decoder */
StartDecoder(lock, pipe);
StartDecoder(lock, pipe, true);
ActivateDecoder();
pc.seeking = true;
@@ -714,7 +717,8 @@ Player::ProcessCommand(std::unique_lock<Mutex> &lock) noexcept
pc.CommandFinished();
if (dc.IsIdle())
StartDecoder(lock, std::make_shared<MusicPipe>());
StartDecoder(lock, std::make_shared<MusicPipe>(),
false);
break;
@@ -985,7 +989,7 @@ Player::Run() noexcept
std::unique_lock<Mutex> lock(pc.mutex);
StartDecoder(lock, pipe);
StartDecoder(lock, pipe, true);
ActivateDecoder();
pc.state = PlayerState::PLAY;
@@ -1025,7 +1029,8 @@ Player::Run() noexcept
assert(dc.pipe == nullptr || dc.pipe == pipe);
StartDecoder(lock, std::make_shared<MusicPipe>());
StartDecoder(lock, std::make_shared<MusicPipe>(),
false);
}
if (/* no cross-fading if MPD is going to pause at the