summaryrefslogtreecommitdiff
path: root/src/output/Control.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-05-23 00:03:06 +0200
committerMax Kellermann <max@musicpd.org>2017-06-08 22:13:47 +0200
commit613dd67784798434b611d88647a6b060b0abce14 (patch)
tree2eddfa64f72ded03201a85be0feb1d6b98c5d9cf /src/output/Control.cxx
parent58683f02ec5aef961dd628ece94b29e171f14132 (diff)
output/Internal: move the AudioOutputSource to struct AudioOutputControl
Diffstat (limited to 'src/output/Control.cxx')
-rw-r--r--src/output/Control.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/output/Control.cxx b/src/output/Control.cxx
index bcc38f5be..557b7946b 100644
--- a/src/output/Control.cxx
+++ b/src/output/Control.cxx
@@ -245,15 +245,19 @@ AudioOutputControl::LockUpdate(const AudioFormat audio_format,
}
bool
-AudioOutputControl::LockIsChunkConsumed(const MusicChunk &chunk) const noexcept
+AudioOutputControl::IsChunkConsumed(const MusicChunk &chunk) const noexcept
{
- return output->LockIsChunkConsumed(chunk);
+ if (!output->open)
+ return true;
+
+ return source.IsChunkConsumed(chunk);
}
-void
-AudioOutputControl::ClearTailChunk(const MusicChunk &chunk) noexcept
+bool
+AudioOutputControl::LockIsChunkConsumed(const MusicChunk &chunk) const noexcept
{
- output->ClearTailChunk(chunk);
+ const std::lock_guard<Mutex> protect(mutex);
+ return IsChunkConsumed(chunk);
}
void
@@ -335,12 +339,6 @@ AudioOutputControl::LockCloseWait() noexcept
}
void
-AudioOutputControl::SetReplayGainMode(ReplayGainMode _mode) noexcept
-{
- return output->SetReplayGainMode(_mode);
-}
-
-void
AudioOutputControl::StopThread() noexcept
{
assert(thread.IsDefined());