summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-11-12 12:21:59 +0100
committerMax Kellermann <max@musicpd.org>2018-11-12 12:21:59 +0100
commit5eaf2b8fc3736f73df433c81fbca0941d184f7c5 (patch)
tree380e54600f5f02a773c4216c8fee8fa79fc97bcf
parente097fef79e66b6ff6cf04a911067d3750b20bd48 (diff)
output/control: always close the `AudioOutputSource` in `RELEASE`
Fixes a crash bug with `always_on` outputs which occurs because the `AudioOutputSource` still has a pointer to an outdated `MusicChunk`. Fixes #415
-rw-r--r--NEWS2
-rw-r--r--src/output/Thread.cxx7
2 files changed, 7 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index cece79a95..fa66df85a 100644
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,7 @@ ver 0.21.2 (not yet released)
- ffmpeg: fix broken sound with certain codecs
* output
- alsa: fix high CPU usage with dmix
- - httpd: fix two crash bugs
+ - httpd: fix three crash bugs
* mixer
- alsa: fix more rounding errors
* fix zlib support
diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx
index b88eecbad..b0556b34d 100644
--- a/src/output/Thread.cxx
+++ b/src/output/Thread.cxx
@@ -467,7 +467,12 @@ AudioOutputControl::Task() noexcept
if (always_on) {
/* in "always_on" mode, the output is
- paused instead of being closed */
+ paused instead of being closed;
+ however we need to close the
+ AudioOutputSource because its data
+ have been invalidated by stopping
+ the actual playback */
+ source.Close();
InternalPause();
} else {
InternalClose(false);