[jack] make port to connect to configurable via environment variables
authorTorben Hohn <torbenh@gmx.de>
Mon, 30 Mar 2009 23:47:01 +0000 (31 01:47 +0200)
committerTorben Hohn <torbenh@gmx.de>
Mon, 30 Mar 2009 23:47:01 +0000 (31 01:47 +0200)
flashsupport.c

index b6f84e7..e001142 100644 (file)
@@ -1159,6 +1159,8 @@ static void *FPX_SoundOutput_Open(void) {
     int jack_rate;
     int flash_frames;
     size_t bufsize;
+    char *connect_port_1 = getenv( "JACK_FLASH_PORT_1" );
+    char *connect_port_2 = getenv( "JACK_FLASH_PORT_2" );
 
     /* Unfortunately we cannot report any useful error string back to
      * Flash. It would be highly preferable if Flash supported some
@@ -1197,9 +1199,9 @@ static void *FPX_SoundOutput_Open(void) {
     jack_activate( p->client );
 
     snprintf( namebuf, 99, "%s:out1", jack_get_client_name( p->client ) );
-    jack_connect( p->client, namebuf, "system:playback_1" );
+    jack_connect( p->client, namebuf, (connect_port_1 != NULL) ? connect_port_1 : "system:playback_1" );
     snprintf( namebuf, 99, "%s:out2", jack_get_client_name( p->client ) );
-    jack_connect( p->client, namebuf, "system:playback_2" );
+    jack_connect( p->client, namebuf, (connect_port_2 != NULL) ? connect_port_2 : "system:playback_1" );
 
     return p;