| 297 | } |
| 298 | |
| 299 | bool |
| 300 | AudioOutputControl::LockUpdate(const AudioFormat audio_format, |
| 301 | const MusicPipe &mp, |
| 302 | bool force) noexcept |
| 303 | { |
| 304 | std::unique_lock lock{mutex}; |
| 305 | |
| 306 | if (enabled && really_enabled) { |
| 307 | if (force || !fail_timer.IsDefined() || |
| 308 | fail_timer.Check(REOPEN_AFTER)) { |
| 309 | return Open(std::move(lock), audio_format, mp); |
| 310 | } |
| 311 | } else if (IsOpen()) |
| 312 | CloseWait(lock); |
| 313 | |
| 314 | return false; |
| 315 | } |
| 316 | |
| 317 | bool |
| 318 | AudioOutputControl::IsChunkConsumed(const MusicChunk &chunk) const noexcept |