summaryrefslogtreecommitdiff
path: root/drivers/pulseaudio
diff options
context:
space:
mode:
authorNathan Franke <natfra@pm.me>2021-11-03 04:03:54 -0500
committerNathan Franke <natfra@pm.me>2021-11-06 18:23:33 -0500
commit72d8aac3a19f89ea8a2866715d1281d98814d7ea (patch)
tree0c29d89ff2d44c91371747089dcc09f1aed13d96 /drivers/pulseaudio
parent7538c052158071e68054b6e6e0d5a2e9df8ee4f2 (diff)
Use application name for pulseaudio device
Diffstat (limited to 'drivers/pulseaudio')
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index 64fc94ea91..1233f0f632 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -34,6 +34,7 @@
#include "core/config/project_settings.h"
#include "core/os/os.h"
+#include "core/version.h"
#ifdef ALSAMIDI_ENABLED
#include "drivers/alsa/asound-so_wrap.h"
@@ -293,7 +294,17 @@ Error AudioDriverPulseAudio::init() {
pa_ml = pa_mainloop_new();
ERR_FAIL_COND_V(pa_ml == nullptr, ERR_CANT_OPEN);
- pa_ctx = pa_context_new(pa_mainloop_get_api(pa_ml), "Godot");
+ String context_name;
+ if (Engine::get_singleton()->is_editor_hint()) {
+ context_name = VERSION_NAME " Editor";
+ } else {
+ context_name = GLOBAL_GET("application/config/name");
+ if (context_name.is_empty()) {
+ context_name = VERSION_NAME " Project";
+ }
+ }
+
+ pa_ctx = pa_context_new(pa_mainloop_get_api(pa_ml), context_name.utf8().ptr());
ERR_FAIL_COND_V(pa_ctx == nullptr, ERR_CANT_OPEN);
pa_ready = 0;