diff options
| author | Nicky <nicky.dasmijn@posteo.nl> | 2024-04-21 18:50:38 +0200 |
|---|---|---|
| committer | Nicky <nicky.dasmijn@posteo.nl> | 2024-04-21 18:50:38 +0200 |
| commit | 19c6368991706d1bcb4a3b02e08cd70e1e6324c7 (patch) | |
| tree | d26e65c00c38d2a2a944872a671b783e3253e1be /indra/media_plugins/cef/linux/volume_catcher_linux.cpp | |
| parent | d09ec5e87bfd892306ccdba56944583bd9213aaf (diff) | |
Stream the volume catcher a little:
- Use LL_DEBUGS() for potential debug output.
- Enclose mutex locking in their own scope, to make unlocking automatic and also limit the life time of a lock to as short as possible
- Introduce mCleanupMutex to replace std::unique_lock pwLock(*this). I'm baffled using lock as a mutex like that did even compile.
- Remove virtual inheritance, as it is not needed here.
Diffstat (limited to 'indra/media_plugins/cef/linux/volume_catcher_linux.cpp')
| -rw-r--r-- | indra/media_plugins/cef/linux/volume_catcher_linux.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/indra/media_plugins/cef/linux/volume_catcher_linux.cpp b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp index 3c037b45ba..439c0a6768 100644 --- a/indra/media_plugins/cef/linux/volume_catcher_linux.cpp +++ b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp @@ -32,28 +32,29 @@ VolumeCatcher::VolumeCatcher() { - // only init once we receive which implementation to use - - // debugClear(); - // debugPrint("init volume catcher\n"); } -void VolumeCatcher::onEnablePipeWireVolumeCatcher(bool enable) { +void VolumeCatcher::onEnablePipeWireVolumeCatcher(bool enable) +{ if (pimpl != nullptr) return; - if (enable) { - // debugPrint("volume catcher using pipewire\n"); + if (enable) + { + LL_DEBUGS() << "volume catcher using pipewire" << LL_ENDL; pimpl = new VolumeCatcherPipeWire(); - } else { - // debugPrint("volume catcher using pulseaudio\n"); + } + else + { + LL_DEBUGS() << "volume catcher using pulseaudio" << LL_ENDL; pimpl = new VolumeCatcherPulseAudio(); } } VolumeCatcher::~VolumeCatcher() { - if (pimpl != nullptr) { + if (pimpl != nullptr) + { delete pimpl; pimpl = nullptr; } @@ -68,15 +69,12 @@ void VolumeCatcher::setVolume(F32 volume) void VolumeCatcher::setPan(F32 pan) { - if (pimpl != nullptr) { + if (pimpl != nullptr) pimpl->setPan(pan); - } } void VolumeCatcher::pump() { - if (pimpl != nullptr) { + if (pimpl != nullptr) pimpl->pump(); - } } - |
