output/Source: reset current_chunk in Open()

If the output is already open, the `current_chunk` pointer may be
bogus and out of sync with `SharedPipeConsumer::chunk`, leading to an
assertion failure in `SharedPipeConsumer::Consume()`.

Fixes #411
This commit is contained in:
Max Kellermann
2018-11-07 00:17:48 +01:00
parent 451b142e3a
commit b1fe105904
2 changed files with 5 additions and 1 deletions

View File

@@ -41,8 +41,10 @@ AudioOutputSource::Open(const AudioFormat audio_format, const MusicPipe &_pipe,
{
assert(audio_format.IsValid());
if (!IsOpen() || &_pipe != &pipe.GetPipe())
if (!IsOpen() || &_pipe != &pipe.GetPipe()) {
current_chunk = nullptr;
pipe.Init(_pipe);
}
/* (re)open the filter */