diff --git a/src/common/cubeb_audio_stream.cpp b/src/common/cubeb_audio_stream.cpp index ccf1dc5ec..0cfdfb44b 100644 --- a/src/common/cubeb_audio_stream.cpp +++ b/src/common/cubeb_audio_stream.cpp @@ -118,14 +118,7 @@ long CubebAudioStream::DataCallback(cubeb_stream* stm, void* user_ptr, const voi long nframes) { CubebAudioStream* const this_ptr = static_cast(user_ptr); - - if (this_ptr->m_output_volume_changed.load()) - { - this_ptr->m_output_volume_changed.store(false); - cubeb_stream_set_volume(this_ptr->m_cubeb_stream, static_cast(this_ptr->m_output_volume) / 100.0f); - } - - this_ptr->ReadFrames(reinterpret_cast(output_buffer), static_cast(nframes), false); + this_ptr->ReadFrames(reinterpret_cast(output_buffer), static_cast(nframes), true); return nframes; } @@ -149,12 +142,6 @@ void CubebAudioStream::DestroyContext() #endif } -void CubebAudioStream::SetOutputVolume(u32 volume) -{ - AudioStream::SetOutputVolume(volume); - m_output_volume_changed.store(true); -} - std::unique_ptr AudioStream::CreateCubebAudioStream() { return std::make_unique(); diff --git a/src/common/cubeb_audio_stream.h b/src/common/cubeb_audio_stream.h index ea5e3cf90..088c0c867 100644 --- a/src/common/cubeb_audio_stream.h +++ b/src/common/cubeb_audio_stream.h @@ -1,7 +1,6 @@ #pragma once #include "common/audio_stream.h" #include "cubeb/cubeb.h" -#include #include class CubebAudioStream final : public AudioStream @@ -10,8 +9,6 @@ public: CubebAudioStream(); ~CubebAudioStream(); - void SetOutputVolume(u32 volume) override; - protected: bool IsOpen() const { return m_cubeb_stream != nullptr; } @@ -29,7 +26,6 @@ protected: cubeb* m_cubeb_context = nullptr; cubeb_stream* m_cubeb_stream = nullptr; bool m_paused = true; - std::atomic_bool m_output_volume_changed{ false }; #ifdef WIN32 bool m_com_initialized_by_us = false;