aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthexai <58434170+thexai@users.noreply.github.com>2024-04-27 10:27:48 +0200
committerthexai <58434170+thexai@users.noreply.github.com>2024-09-16 17:23:12 +0200
commit55698da23d7e36543241b68e78538ed8c9485e77 (patch)
tree7412aa7794a7488723ff854608de4215bd5a73fd
parentc63c26ffb726e78a6dd74d7e4a45c88295f64356 (diff)
XAudio: simplifies variables initialization
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkXAudio.cpp20
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkXAudio.h37
2 files changed, 20 insertions, 37 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkXAudio.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkXAudio.cpp
index 70924d1dde..3caae374ee 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkXAudio.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkXAudio.cpp
@@ -50,25 +50,7 @@ inline void SafeDestroyVoice(TVoice **ppVoice)
/// ----------------- CAESinkXAudio ------------------------
-CAESinkXAudio::CAESinkXAudio() :
- m_masterVoice(nullptr),
- m_sourceVoice(nullptr),
- m_encodedChannels(0),
- m_encodedSampleRate(0),
- sinkReqFormat(AE_FMT_INVALID),
- sinkRetFormat(AE_FMT_INVALID),
- m_AvgBytesPerSec(0),
- m_dwChunkSize(0),
- m_dwFrameSize(0),
- m_dwBufferLen(0),
- m_sinkFrames(0),
- m_framesInBuffers(0),
- m_running(false),
- m_initialized(false),
- m_isSuspended(false),
- m_isDirty(false),
- m_uiBufferLen(0),
- m_avgTimeWaiting(50)
+CAESinkXAudio::CAESinkXAudio()
{
m_channelLayout.Reset();
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkXAudio.h b/xbmc/cores/AudioEngine/Sinks/AESinkXAudio.h
index 103b45939e..284dde354a 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkXAudio.h
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkXAudio.h
@@ -129,31 +129,32 @@ private:
XAUDIO2_BUFFER BuildXAudio2Buffer(uint8_t** data, unsigned int frames, unsigned int offset);
Microsoft::WRL::ComPtr<IXAudio2> m_xAudio2;
- IXAudio2MasteringVoice* m_masterVoice;
- IXAudio2SourceVoice* m_sourceVoice;
+ IXAudio2MasteringVoice* m_masterVoice{nullptr};
+ IXAudio2SourceVoice* m_sourceVoice{nullptr};
VoiceCallback m_voiceCallback;
AEAudioFormat m_format;
- unsigned int m_encodedChannels;
- unsigned int m_encodedSampleRate;
+ unsigned int m_encodedChannels{0};
+ unsigned int m_encodedSampleRate{0};
CAEChannelInfo m_channelLayout;
std::string m_device;
- enum AEDataFormat sinkReqFormat;
- enum AEDataFormat sinkRetFormat;
+ AEDataFormat sinkReqFormat{AE_FMT_INVALID};
+ AEDataFormat sinkRetFormat{AE_FMT_INVALID};
- unsigned int m_uiBufferLen; /* xaudio endpoint buffer size, in frames */
- unsigned int m_AvgBytesPerSec;
- unsigned int m_dwChunkSize;
- unsigned int m_dwFrameSize;
- unsigned int m_dwBufferLen;
- uint64_t m_sinkFrames;
- std::atomic<uint16_t> m_framesInBuffers;
+ unsigned int m_uiBufferLen{0}; // xaudio endpoint buffer size, in frames
+ unsigned int m_AvgBytesPerSec{0};
+ unsigned int m_dwChunkSize{0};
+ unsigned int m_dwFrameSize{0};
+ unsigned int m_dwBufferLen{0};
+ uint64_t m_sinkFrames{0};
+ std::atomic<uint16_t> m_framesInBuffers{0};
- double m_avgTimeWaiting; /* time between next buffer of data from SoftAE and driver call for data */
+ // time between next buffer of data from SoftAE and driver call for data
+ double m_avgTimeWaiting{50.0};
- bool m_running;
- bool m_initialized;
- bool m_isSuspended; /* sink is in a suspended state - release audio device */
- bool m_isDirty; /* sink output failed - needs re-init or new device */
+ bool m_running{false};
+ bool m_initialized{false};
+ bool m_isSuspended{false}; // sink is in a suspended state - release audio device
+ bool m_isDirty{false}; // sink output failed - needs re-init or new device
};