diff --git a/NEWS b/NEWS index 8d4064b11..015ce011c 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.20.2 (not yet released) +* input + - alsa: fix crash bug * decoder - flac: add options "probesize" and "analyzeduration" * resampler diff --git a/src/input/plugins/AlsaInputPlugin.cxx b/src/input/plugins/AlsaInputPlugin.cxx index b3eceb53a..b0e8ab7d4 100644 --- a/src/input/plugins/AlsaInputPlugin.cxx +++ b/src/input/plugins/AlsaInputPlugin.cxx @@ -28,6 +28,7 @@ #include "AlsaInputPlugin.hxx" #include "../InputPlugin.hxx" #include "../AsyncInputStream.hxx" +#include "event/Call.hxx" #include "util/Domain.hxx" #include "util/RuntimeError.hxx" #include "util/StringCompare.hxx" @@ -99,6 +100,14 @@ public: } ~AlsaInputStream() { + /* ClearSocketList must be called from within the + IOThread; if we don't do it manually here, the + ~MultiSocketMonitor() will do it in the current + thread */ + BlockingCall(MultiSocketMonitor::GetEventLoop(), [this](){ + ClearSocketList(); + }); + snd_pcm_close(capture_handle); }