diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 13:23:58 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch) | |
tree | a27e497da7104dd0a64f98a04fa3067668735e91 /drivers/pulseaudio | |
parent | 710b34b70227becdc652b4ae027fe0ac47409642 (diff) |
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.
This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.
There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).
Part of #33027.
Diffstat (limited to 'drivers/pulseaudio')
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.cpp | 24 | ||||
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.h | 1 |
2 files changed, 0 insertions, 25 deletions
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index b16408f727..8d704dae7b 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -78,7 +78,6 @@ void AudioDriverPulseAudio::pa_source_info_cb(pa_context *c, const pa_source_inf } void AudioDriverPulseAudio::pa_server_info_cb(pa_context *c, const pa_server_info *i, void *userdata) { - ERR_FAIL_COND_MSG(!i, "PulseAudio server info is null."); AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata; @@ -88,7 +87,6 @@ void AudioDriverPulseAudio::pa_server_info_cb(pa_context *c, const pa_server_inf } void AudioDriverPulseAudio::detect_channels(bool capture) { - pa_channel_map_init_stereo(capture ? &pa_rec_map : &pa_map); String device = capture ? capture_device_name : device_name; @@ -145,7 +143,6 @@ void AudioDriverPulseAudio::detect_channels(bool capture) { } Error AudioDriverPulseAudio::init_device() { - // If there is a specified device check that it is really present if (device_name != "Default") { Array list = get_device_list(); @@ -236,7 +233,6 @@ Error AudioDriverPulseAudio::init_device() { } Error AudioDriverPulseAudio::init() { - active = false; thread_exited = false; exit_thread = false; @@ -298,7 +294,6 @@ Error AudioDriverPulseAudio::init() { } float AudioDriverPulseAudio::get_latency() { - if (latency == 0) { //only do this once since it's approximate anyway lock(); @@ -324,14 +319,12 @@ float AudioDriverPulseAudio::get_latency() { } void AudioDriverPulseAudio::thread_func(void *p_udata) { - AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)p_udata; unsigned int write_ofs = 0; size_t avail_bytes = 0; uint32_t default_device_msec = OS::get_singleton()->get_ticks_msec(); while (!ad->exit_thread) { - size_t read_bytes = 0; size_t written_bytes = 0; @@ -421,7 +414,6 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) { // If we're using the default device check that the current device is still the default if (ad->device_name == "Default") { - uint32_t msec = OS::get_singleton()->get_ticks_msec(); if (msec > (default_device_msec + 1000)) { String old_default_device = ad->default_device; @@ -524,17 +516,14 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) { } void AudioDriverPulseAudio::start() { - active = true; } int AudioDriverPulseAudio::get_mix_rate() const { - return mix_rate; } AudioDriver::SpeakerMode AudioDriverPulseAudio::get_speaker_mode() const { - return get_speaker_mode_by_total_channels(channels); } @@ -551,7 +540,6 @@ void AudioDriverPulseAudio::pa_sinklist_cb(pa_context *c, const pa_sink_info *l, } Array AudioDriverPulseAudio::get_device_list() { - pa_devices.clear(); pa_devices.push_back("Default"); @@ -583,33 +571,28 @@ Array AudioDriverPulseAudio::get_device_list() { } String AudioDriverPulseAudio::get_device() { - return device_name; } void AudioDriverPulseAudio::set_device(String device) { - lock(); new_device = device; unlock(); } void AudioDriverPulseAudio::lock() { - if (!thread) return; mutex.lock(); } void AudioDriverPulseAudio::unlock() { - if (!thread) return; mutex.unlock(); } void AudioDriverPulseAudio::finish_device() { - if (pa_str) { pa_stream_disconnect(pa_str); pa_stream_unref(pa_str); @@ -618,7 +601,6 @@ void AudioDriverPulseAudio::finish_device() { } void AudioDriverPulseAudio::finish() { - if (!thread) return; @@ -644,7 +626,6 @@ void AudioDriverPulseAudio::finish() { } Error AudioDriverPulseAudio::capture_init_device() { - // If there is a specified device check that it is really present if (capture_device_name != "Default") { Array list = capture_get_device_list(); @@ -702,7 +683,6 @@ Error AudioDriverPulseAudio::capture_init_device() { } void AudioDriverPulseAudio::capture_finish_device() { - if (pa_rec_str) { int ret = pa_stream_disconnect(pa_rec_str); if (ret != 0) { @@ -714,7 +694,6 @@ void AudioDriverPulseAudio::capture_finish_device() { } Error AudioDriverPulseAudio::capture_start() { - lock(); Error err = capture_init_device(); unlock(); @@ -731,7 +710,6 @@ Error AudioDriverPulseAudio::capture_stop() { } void AudioDriverPulseAudio::capture_set_device(const String &p_name) { - lock(); capture_new_device = p_name; unlock(); @@ -753,7 +731,6 @@ void AudioDriverPulseAudio::pa_sourcelist_cb(pa_context *c, const pa_source_info } Array AudioDriverPulseAudio::capture_get_device_list() { - pa_rec_devices.clear(); pa_rec_devices.push_back("Default"); @@ -785,7 +762,6 @@ Array AudioDriverPulseAudio::capture_get_device_list() { } String AudioDriverPulseAudio::capture_get_device() { - lock(); String name = capture_device_name; unlock(); diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.h b/drivers/pulseaudio/audio_driver_pulseaudio.h index ab55a15076..2f2ad0fc38 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.h +++ b/drivers/pulseaudio/audio_driver_pulseaudio.h @@ -40,7 +40,6 @@ #include <pulse/pulseaudio.h> class AudioDriverPulseAudio : public AudioDriver { - Thread *thread = nullptr; Mutex mutex; |