input/alsa: clear sockets from within IOThread
Fixes assertion failure in implicit destructor.
This commit is contained in:
parent
c7b0c46d9f
commit
05417049eb
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
||||||
ver 0.20.2 (not yet released)
|
ver 0.20.2 (not yet released)
|
||||||
|
* input
|
||||||
|
- alsa: fix crash bug
|
||||||
* decoder
|
* decoder
|
||||||
- flac: add options "probesize" and "analyzeduration"
|
- flac: add options "probesize" and "analyzeduration"
|
||||||
* resampler
|
* resampler
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "AlsaInputPlugin.hxx"
|
#include "AlsaInputPlugin.hxx"
|
||||||
#include "../InputPlugin.hxx"
|
#include "../InputPlugin.hxx"
|
||||||
#include "../AsyncInputStream.hxx"
|
#include "../AsyncInputStream.hxx"
|
||||||
|
#include "event/Call.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
#include "util/RuntimeError.hxx"
|
#include "util/RuntimeError.hxx"
|
||||||
#include "util/StringCompare.hxx"
|
#include "util/StringCompare.hxx"
|
||||||
|
@ -99,6 +100,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
~AlsaInputStream() {
|
~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);
|
snd_pcm_close(capture_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue