[polypaudio-commits] r523 - in /trunk/src/polyp: context.c context.h def.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Feb 20 08:10:21 PST 2006


Author: lennart
Date: Mon Feb 20 17:10:20 2006
New Revision: 523

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=523&root=polypaudio&view=rev
Log:
replace "spawn" parameter of pa_context_new() with a proper flags parameter

Modified:
    trunk/src/polyp/context.c
    trunk/src/polyp/context.h
    trunk/src/polyp/def.h

Modified: trunk/src/polyp/context.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/context.c?rev=523&root=polypaudio&r1=522&r2=523&view=diff
==============================================================================
--- trunk/src/polyp/context.c (original)
+++ trunk/src/polyp/context.c Mon Feb 20 17:10:20 2006
@@ -593,7 +593,7 @@
     pa_context_unref(c);
 }
 
-int pa_context_connect(pa_context *c, const char *server, int spawn, const pa_spawn_api *api) {
+int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api) {
     int r = -1;
     assert(c && c->ref >= 1 && c->state == PA_CONTEXT_UNCONNECTED);
 
@@ -632,7 +632,7 @@
         c->server_list = pa_strlist_prepend(c->server_list, pa_runtime_path(PA_NATIVE_DEFAULT_UNIX_SOCKET, ufn, sizeof(ufn)));
 
         /* Wrap the connection attempts in a single transaction for sane autospawn locking */
-        if (spawn && c->conf->autospawn) {
+        if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) {
             char lf[PATH_MAX];
 
             pa_runtime_path(AUTOSPAWN_LOCK, lf, sizeof(lf));

Modified: trunk/src/polyp/context.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/context.h?rev=523&root=polypaudio&r1=522&r2=523&view=diff
==============================================================================
--- trunk/src/polyp/context.h (original)
+++ trunk/src/polyp/context.h Mon Feb 20 17:10:20 2006
@@ -84,11 +84,11 @@
 /** Connect the context to the specified server. If server is NULL,
 connect to the default server. This routine may but will not always
 return synchronously on error. Use pa_context_set_state_callback() to
-be notified when the connection is established. If spawn is non-zero
-and no specific server is specified or accessible a new daemon is
-spawned. If api is non-NULL, the functions specified in the structure
-are used when forking a new child process. */
-int pa_context_connect(pa_context *c, const char *server, int spawn, const pa_spawn_api *api);
+be notified when the connection is established. If flags doesn't have
+PA_NOAUTOSPAWN set and no specific server is specified or accessible a
+new daemon is spawned. If api is non-NULL, the functions specified in
+the structure are used when forking a new child process. */
+int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api);
 
 /** Terminate the context connection immediately */
 void pa_context_disconnect(pa_context *c);

Modified: trunk/src/polyp/def.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/def.h?rev=523&root=polypaudio&r1=522&r2=523&view=diff
==============================================================================
--- trunk/src/polyp/def.h (original)
+++ trunk/src/polyp/def.h Mon Feb 20 17:10:20 2006
@@ -63,6 +63,11 @@
 
 /** An invalid index */
 #define PA_INVALID_INDEX ((uint32_t) -1)
+
+/** Some special flags for contexts. \ since 0.8 */
+typedef enum pa_context_flags {
+    PA_CONTEXT_NOAUTOSPAWN = 1 /**< Disabled autospawning of the polypaudio daemon if required */
+} pa_context_flags_t;
 
 /** The direction of a pa_stream object */ 
 typedef enum pa_stream_direction {




More information about the pulseaudio-commits mailing list