]> code.delx.au - pulseaudio/commitdiff
add new property PA_PROP_APPLICATION_PROCESS_SESSION_ID and initialize it by default
authorLennart Poettering <lennart@poettering.net>
Sat, 21 Feb 2009 15:26:09 +0000 (16:26 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 21 Feb 2009 15:26:09 +0000 (16:26 +0100)
src/pulse/proplist.h
src/pulsecore/proplist-util.c

index c0c3459367330bce1c8f0552b4c963e0967c112c..7a58568255abb6d207204c409f374f1e69c740c0 100644 (file)
@@ -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"
 
index d78eac07c5e4b7a46c4f5d079fb4202c5368a1d2..7ba2fd71a856dd93a47b1ea08c35edbccacce89a 100644 (file)
@@ -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);
+        }
+    }
 }