decoder/Bridge: move code to DecoderControl::SetReady()

This commit is contained in:
Max Kellermann
2016-12-03 14:20:51 +01:00
parent 9fb7cc796b
commit b3723274f7
3 changed files with 36 additions and 17 deletions

View File

@@ -53,6 +53,27 @@ DecoderControl::WaitForDecoder()
client_is_waiting = false;
}
void
DecoderControl::SetReady(const AudioFormat audio_format,
bool _seekable, SignedSongTime _duration)
{
assert(state == DecoderState::START);
assert(pipe != nullptr);
assert(pipe->IsEmpty());
assert(audio_format.IsDefined());
assert(audio_format.IsValid());
in_audio_format = audio_format;
out_audio_format = audio_format;
out_audio_format.ApplyMask(configured_audio_format);
seekable = _seekable;
total_time = _duration;
state = DecoderState::DECODE;
client_cond.signal();
}
bool
DecoderControl::IsCurrentSong(const DetachedSong &_song) const
{