summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-03-08 19:53:50 +0100
committerMax Kellermann <max@musicpd.org>2021-03-10 20:38:41 +0100
commit73f9824ddf7c7a917b89f0bb500985c15273530d (patch)
tree056026749c34a4a7bcc05f312fe58e6d9947cefe /src/output
parent1fe0c673bc3ead4e99e47e61e7aa3f0ed590bbba (diff)
output/wasapi: eliminate `friend` declaration
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/wasapi/WasapiOutputPlugin.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
index e7075c0b5..5e0226930 100644
--- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
+++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
@@ -158,7 +158,6 @@ SetDSDFallback(AudioFormat &audio_format) noexcept
} // namespace
class WasapiOutputThread {
- friend class WasapiOutput;
Thread thread{BIND_THIS_METHOD(Work)};
WinEvent event;
WinEvent data_poped;
@@ -204,6 +203,11 @@ public:
void Play() noexcept { return SetStatus(Status::PLAY); }
void Pause() noexcept { return SetStatus(Status::PAUSE); }
+ std::size_t Push(ConstBuffer<void> input) noexcept {
+ return spsc_buffer.push(static_cast<const BYTE *>(input.data),
+ input.size);
+ }
+
/**
* Instruct the thread to discard the buffer (and wait for
* completion). This needs to be done inside this thread,
@@ -672,8 +676,7 @@ WasapiOutput::Play(const void *chunk, size_t size)
return size;
do {
- const size_t consumed_size = thread->spsc_buffer.push(
- static_cast<const BYTE *>(input.data), input.size);
+ const size_t consumed_size = thread->Push({chunk, size});
if (!is_started) {
is_started = true;