Skip to content

Commit

Permalink
Use application name for pulseaudio device
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfranke committed Nov 6, 2021
1 parent 7538c05 commit 72d8aac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/pulseaudio/audio_driver_pulseaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 72d8aac

Please sign in to comment.