diff options
author | Romain Rollet <romain.rollet@gmail.com> | 2015-06-20 15:37:19 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-06-20 15:37:19 +0200 |
commit | ae77542a118120adb4b339ad6ec2ec433bf43533 (patch) | |
tree | ba8b6c0cdc8dba738ac31fe2162ebde4ddaf840e /src | |
parent | 980187f85643adbb67c95d72794fbe74e585acd5 (diff) | |
download | mpd-ae77542a118120adb4b339ad6ec2ec433bf43533.tar.gz mpd-ae77542a118120adb4b339ad6ec2ec433bf43533.tar.xz mpd-ae77542a118120adb4b339ad6ec2ec433bf43533.zip |
OutputControl: fix fail_timer check right after booting
Right after booting, the monotonic clock starts with a very small
value, and AudioOutput::LockUpdate() may believe that the fail_timer
has not recovered yet.
Diffstat (limited to '')
-rw-r--r-- | src/output/OutputControl.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/output/OutputControl.cxx b/src/output/OutputControl.cxx index 89428fa87..9eafdb166 100644 --- a/src/output/OutputControl.cxx +++ b/src/output/OutputControl.cxx @@ -184,7 +184,8 @@ AudioOutput::LockUpdate(const AudioFormat audio_format, const ScopeLock protect(mutex); if (enabled && really_enabled) { - if (fail_timer.Check(REOPEN_AFTER * 1000)) { + if (!fail_timer.IsDefined() || + fail_timer.Check(REOPEN_AFTER * 1000)) { return Open(audio_format, mp); } } else if (IsOpen()) |