From 27bfa607b90b25aa4fdefc0882091093164297a5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 21 Feb 2009 16:26:09 +0100 Subject: add new property PA_PROP_APPLICATION_PROCESS_SESSION_ID and initialize it by default --- src/pulse/proplist.h | 3 +++ src/pulsecore/proplist-util.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/pulse/proplist.h b/src/pulse/proplist.h index c0c34593..7a585682 100644 --- a/src/pulse/proplist.h +++ b/src/pulse/proplist.h @@ -132,6 +132,9 @@ PA_C_DECL_BEGIN /** For clients/streams: the D-Bus host id the application runs on. e.g. "543679e7b01393ed3e3e650047d78f6e" */ #define PA_PROP_APPLICATION_PROCESS_MACHINE_ID "application.process.machine_id" +/** For clients/streams: an id for the login session the application runs in. On Unix the value of $XDG_SESSION_COOKIE. e.g. "543679e7b01393ed3e3e650047d78f6e-1235159798.76193-190367717" */ +#define PA_PROP_APPLICATION_PROCESS_SESSION_ID "application.process.session_id" + /** For devices: device string in the underlying audio layer's format. e.g. "surround51:0" */ #define PA_PROP_DEVICE_STRING "device.string" diff --git a/src/pulsecore/proplist-util.c b/src/pulsecore/proplist-util.c index d78eac07..7ba2fd71 100644 --- a/src/pulsecore/proplist-util.c +++ b/src/pulsecore/proplist-util.c @@ -228,4 +228,14 @@ void pa_init_proplist(pa_proplist *p) { pa_xfree(m); } } + + if (!pa_proplist_contains(p, PA_PROP_APPLICATION_PROCESS_SESSION_ID)) { + const char *t; + + if ((t = getenv("XDG_SESSION_COOKIE"))) { + char *c = pa_utf8_filter(t); + pa_proplist_sets(p, PA_PROP_APPLICATION_PROCESS_SESSION_ID, c); + pa_xfree(c); + } + } } -- cgit