From b1fe1059040cd8fd2cbd8ad7b163c3b30d481902 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 7 Nov 2018 00:17:48 +0100 Subject: [PATCH] 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 --- NEWS | 2 ++ src/output/Source.cxx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f44fa5f23..f244ae53b 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ ver 0.21.2 (not yet released) * decoder - ffmpeg: require FFmpeg 3.1 or later - ffmpeg: fix broken sound with certain codecs +* output + - httpd: fix crash with "always_on" ver 0.21.1 (2018/11/04) * protocol diff --git a/src/output/Source.cxx b/src/output/Source.cxx index e516d05bc..7c47ad40c 100644 --- a/src/output/Source.cxx +++ b/src/output/Source.cxx @@ -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 */