Commit fa2b59df authored by Max Kellermann's avatar Max Kellermann

Main: cap buffer_before_play at 80% to prevent deadlock

Closes #34
parent f41a1694
......@@ -2,6 +2,7 @@ ver 0.20.7 (not yet released)
* database
- simple: fix false positive directory loop detection with NFS
* enforce a reasonable minimum audio_buffer_size setting
* cap buffer_before_play at 80% to prevent deadlock
* fix random crashes when compiled with clang
ver 0.20.6 (2017/03/10)
......
......@@ -340,6 +340,19 @@ initialize_decoder_and_player(const ReplayGainConfig &replay_gain_config)
"than 100 percent, line %i",
param->value.c_str(), param->line);
}
if (perc > 80) {
/* this upper limit should avoid deadlocks
which can occur because the DecoderThread
cannot ever fill the music buffer to
exactly 100%; a few chunks always need to
be available to generate silence in
Player::SendSilence() */
FormatError(config_domain,
"buffer_before_play is too large (%f%%), capping at 80%%; please fix your configuration",
perc);
perc = 80;
}
} else
perc = DEFAULT_BUFFER_BEFORE_PLAY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment