--- pulseaudio-0.9.5/src/modules/module-esound-sink.c	2006-08-18 23:38:48.000000000 +0200
+++ pulseaudio-0.9.5-esound-port/src/modules/module-esound-sink.c	2007-10-01 22:02:51.000000000 +0200
@@ -83,6 +83,7 @@
 
 static const char* const valid_modargs[] = {
     "server",
+    "port",
     "cookie",
     "rate",
     "format",
@@ -321,6 +322,7 @@
     pa_sample_spec ss;
     pa_modargs *ma = NULL;
     char *t;
+    uint32_t port=0;
     
     assert(c && m);
     
@@ -362,10 +364,15 @@
         goto fail;
     }
 
-    if (!(u->client = pa_socket_client_new_string(u->core->mainloop, p = pa_modargs_get_value(ma, "server", ESD_UNIX_SOCKET_NAME), ESD_DEFAULT_PORT))) {
+    if (pa_modargs_get_value_u32(ma, "port", &port) < 0) {
+        port=ESD_DEFAULT_PORT;
+    }
+
+    if (!(u->client = pa_socket_client_new_string(u->core->mainloop, p = pa_modargs_get_value(ma, "server", ESD_UNIX_SOCKET_NAME), port))) {
         pa_log("failed to connect to server.");
         goto fail;
     }
+    
     pa_socket_client_set_callback(u->client, on_connection, u);
 
     /* Prepare the initial request */

