summaryrefslogtreecommitdiff
path: root/drivers/alsa
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-05-14 12:53:38 +0200
committerGitHub <noreply@github.com>2020-05-14 12:53:38 +0200
commit5f5f53e8eba5c9b708714de58d3cca6ceb010279 (patch)
tree8bebdce946466ce8e9476ccd46c9dba62c323938 /drivers/alsa
parente7c9d818766a119089873e4941e4865fb36883ec (diff)
parent1f6f364a56319eabd02c050746fe7df3f55ffee3 (diff)
Merge pull request #38697 from akien-mga/member-init-c++11
Port member default initialization from constructor to declaration (C++11)
Diffstat (limited to 'drivers/alsa')
-rw-r--r--drivers/alsa/audio_driver_alsa.cpp12
-rw-r--r--drivers/alsa/audio_driver_alsa.h12
2 files changed, 7 insertions, 17 deletions
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp
index 48e694dd3a..e394222d3a 100644
--- a/drivers/alsa/audio_driver_alsa.cpp
+++ b/drivers/alsa/audio_driver_alsa.cpp
@@ -331,14 +331,4 @@ void AudioDriverALSA::finish() {
finish_device();
}
-AudioDriverALSA::AudioDriverALSA() :
- thread(nullptr),
- pcm_handle(nullptr),
- device_name("Default"),
- new_device("Default") {
-}
-
-AudioDriverALSA::~AudioDriverALSA() {
-}
-
-#endif
+#endif // ALSA_ENABLED
diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h
index 50bd9e853d..d437993901 100644
--- a/drivers/alsa/audio_driver_alsa.h
+++ b/drivers/alsa/audio_driver_alsa.h
@@ -41,13 +41,13 @@
class AudioDriverALSA : public AudioDriver {
- Thread *thread;
+ Thread *thread = nullptr;
Mutex mutex;
- snd_pcm_t *pcm_handle;
+ snd_pcm_t *pcm_handle = nullptr;
- String device_name;
- String new_device;
+ String device_name = "Default";
+ String new_device = "Default";
Vector<int32_t> samples_in;
Vector<int16_t> samples_out;
@@ -85,8 +85,8 @@ public:
virtual void unlock();
virtual void finish();
- AudioDriverALSA();
- ~AudioDriverALSA();
+ AudioDriverALSA() {}
+ ~AudioDriverALSA() {}
};
#endif // AUDIO_DRIVER_ALSA_H