aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/base.cpp
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2019-07-28 18:56:04 -0700
committerChris Robinson <chris.kcat@gmail.com>2019-07-28 18:56:04 -0700
commitcb3e96e75640730b9391f0d2d922eecd9ee2ce79 (patch)
tree23520551bddb2a80354e44da47f54201fdc084f0 /Alc/backends/base.cpp
parent93e60919c8f387c36c267ca9faa1ac653254aea6 (diff)
Rename Alc to alc
Diffstat (limited to 'Alc/backends/base.cpp')
-rw-r--r--Alc/backends/base.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/Alc/backends/base.cpp b/Alc/backends/base.cpp
deleted file mode 100644
index a7d47c6d..00000000
--- a/Alc/backends/base.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-
-#include "config.h"
-
-#include <cstdlib>
-
-#include <thread>
-
-#include "alcmain.h"
-#include "alu.h"
-
-#include "backends/base.h"
-
-
-ClockLatency GetClockLatency(ALCdevice *device)
-{
- BackendBase *backend{device->Backend.get()};
- ClockLatency ret{backend->getClockLatency()};
- ret.Latency += device->FixedLatency;
- return ret;
-}
-
-
-/* BackendBase method implementations. */
-BackendBase::BackendBase(ALCdevice *device) noexcept : mDevice{device}
-{ }
-
-BackendBase::~BackendBase() = default;
-
-ALCboolean BackendBase::reset()
-{ return ALC_FALSE; }
-
-ALCenum BackendBase::captureSamples(void*, ALCuint)
-{ return ALC_INVALID_DEVICE; }
-
-ALCuint BackendBase::availableSamples()
-{ return 0; }
-
-ClockLatency BackendBase::getClockLatency()
-{
- ClockLatency ret;
-
- ALuint refcount;
- do {
- while(((refcount=mDevice->MixCount.load(std::memory_order_acquire))&1))
- std::this_thread::yield();
- ret.ClockTime = GetDeviceClockTime(mDevice);
- std::atomic_thread_fence(std::memory_order_acquire);
- } while(refcount != mDevice->MixCount.load(std::memory_order_relaxed));
-
- /* NOTE: The device will generally have about all but one periods filled at
- * any given time during playback. Without a more accurate measurement from
- * the output, this is an okay approximation.
- */
- ret.Latency = std::chrono::seconds{maxi(mDevice->BufferSize-mDevice->UpdateSize, 0)};
- ret.Latency /= mDevice->Frequency;
-
- return ret;
-}