summaryrefslogtreecommitdiff
path: root/libs/backends
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-09-01 19:01:18 +0200
committerRobin Gareus <robin@gareus.org>2019-09-01 19:01:18 +0200
commit45cf29b7c5aa315f59b8fccda4639da5508a232d (patch)
tree001cca46e5d442eaa6af01ac8121f82e2bd90992 /libs/backends
parent6746456d3a79d3dc6c6dc105214720a24ae6a0a4 (diff)
Use preferred pa_context_new_with_proplist API
Diffstat (limited to 'libs/backends')
-rw-r--r--libs/backends/pulseaudio/pulseaudio_backend.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/libs/backends/pulseaudio/pulseaudio_backend.cc b/libs/backends/pulseaudio/pulseaudio_backend.cc
index 04ac74a98e..af7138cb1e 100644
--- a/libs/backends/pulseaudio/pulseaudio_backend.cc
+++ b/libs/backends/pulseaudio/pulseaudio_backend.cc
@@ -235,12 +235,30 @@ PulseAudioBackend::init_pulse ()
return BackendInitializationError;
}
- if (!(p_context = pa_context_new (pa_threaded_mainloop_get_api (p_mainloop), PROGRAM_NAME))) {
+ /* see https://freedesktop.org/software/pulseaudio/doxygen/proplist_8h.html */
+ pa_proplist* proplist = pa_proplist_new ();
+ pa_proplist_sets (proplist, PA_PROP_MEDIA_SOFTWARE, PROGRAM_NAME);
+ pa_proplist_sets (proplist, PA_PROP_MEDIA_ROLE, "production");
+#if 0 // TODO
+ /* in tools/linux_packaging/stage2.run.in uses xdg
+ * ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}"
+ * e.g. "Harrison-Mixbus32C_3.7.24" "Ardour-Ardour_5.12.0"
+ *
+ * gtk2_ardour/wscript $ARDOUR_ICON is used in .desktop.in
+ * 'ardour<major>'
+ */
+ pa_proplist_sets (proplist, PA_PROP_APPLICATION_ICON_NAME, "Ardour-Ardour_5.12.0");
+#endif
+
+ if (!(p_context = pa_context_new_with_proplist (pa_threaded_mainloop_get_api (p_mainloop), PROGRAM_NAME, proplist))) {
PBD::error << _("PulseAudioBackend: Failed to allocate context") << endmsg;
close_pulse ();
+ pa_proplist_free (proplist);
return BackendInitializationError;
}
+ pa_proplist_free (proplist);
+
pa_context_set_state_callback (p_context, PulseAudioBackend::context_state_cb, this);
if (pa_context_connect (p_context, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0) {