output/Source: release the mutex while the filter runs

The filter can take some time to finish, even more so on a weak
machine with a saturated CPU.  By not holding the mutex during that
time, we can reduce PlayerThread latency a lot, because that thread
needs to synchronize a lot with all outputs.
This commit is contained in:
Max Kellermann
2016-12-26 20:02:15 +01:00
parent 86d3b25aec
commit b6004b6837
3 changed files with 12 additions and 3 deletions

View File

@@ -264,7 +264,7 @@ AudioOutput::WaitForDelay()
bool
AudioOutput::FillSourceOrClose()
try {
return source.Fill();
return source.Fill(mutex);
} catch (const std::runtime_error &e) {
FormatError(e, "Failed to filter for output \"%s\" [%s]",
name, plugin.name);