output/alsa: disable events in Cancel()
Don't reactivate the PCM device immediately after Cancel() is finished; if Cancel() gets called this may mean that new data may take a while to produce, or no data at all will be produced because the current song is being stopped. Once new data is available, Play() will automatically reactivate the PCM. This fixes underruns when switching songs manually (closes #264).
This commit is contained in:
parent
8a809013f3
commit
98d76627a5
|
@ -779,6 +779,14 @@ AlsaOutput::CancelInternal() noexcept
|
||||||
pcm_export->Reset();
|
pcm_export->Reset();
|
||||||
period_buffer.Clear();
|
period_buffer.Clear();
|
||||||
ClearRingBuffer();
|
ClearRingBuffer();
|
||||||
|
|
||||||
|
{
|
||||||
|
const std::lock_guard<Mutex> lock(mutex);
|
||||||
|
active = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
MultiSocketMonitor::Reset();
|
||||||
|
defer_invalidate_sockets.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue