]> code.delx.au - pulseaudio/commitdiff
some fixes
authorLennart Poettering <lennart@poettering.net>
Thu, 24 Jun 2004 23:27:06 +0000 (23:27 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 24 Jun 2004 23:27:06 +0000 (23:27 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@36 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/Makefile.am
src/main.c
src/module-protocol-stub.c
src/pdispatch.c
src/polyp.c
src/socket-client.c
src/tagstruct.c

index c3a33ce3d5071ca8a2ad44d32f0524b8730db0ba..75da02c17d5497ef2c1ec87af25997b81390ec05 100644 (file)
@@ -28,7 +28,7 @@ pkglib_LTLIBRARIES=libiochannel.la libsocket-server.la libsocket-client.la \
                module-simple-protocol-unix.la module-cli-protocol-tcp.la \
                libprotocol-cli.la module-cli-protocol-unix.la libtagstruct.la \
                libpdispatch.la libprotocol-native.la libpstream-util.la \
-               module-native-protocol-tcp.la module-native-protocol-unix.la \
+               module-native-protocol-tcp.la module-native-protocol-unix.la \
                libpolyp.la
 
 polypaudio_SOURCES = idxset.c idxset.h \
@@ -110,7 +110,7 @@ libprotocol_cli_la_LIBADD = libsocket-server.la libiochannel.la libcli.la
 
 libprotocol_native_la_SOURCES = protocol-native.c protocol-native.h
 libprotocol_native_la_LDFLAGS = -avoid-version
-libprotocol_native_la_LIBADD = libsocket-server.la libiochannel.la libpacket.la libpstream.la libpstream-util.la
+libprotocol_native_la_LIBADD = libsocket-server.la libiochannel.la libpacket.la libpstream.la libpstream-util.la libpdispatch.la
 
 libtagstruct_la_SOURCES = tagstruct.c tagstruct.h
 libtagstruct_la_LDFLAGS = -avoid-version
index ef25b5e30a0016c5037a6a1180bb838742e64c3e..0fe333e0e77cf4da735c993001d6f01cac113a69 100644 (file)
@@ -39,8 +39,13 @@ int main(int argc, char *argv[]) {
     assert(c);
 
     module_load(c, "module-oss-mmap", "/dev/dsp1");
-    module_load(c, "module-pipe-sink", NULL);
+/*    module_load(c, "module-pipe-sink", NULL);
     module_load(c, "module-simple-protocol-tcp", NULL);
+    module_load(c, "module-simple-protocol-unix", NULL);*/
+    module_load(c, "module-cli-protocol-tcp", NULL);
+/*    module_load(c, "module-cli-protocol-unix", NULL);
+    module_load(c, "module-native-protocol-tcp", NULL);*/
+    module_load(c, "module-native-protocol-unix", NULL);
     module_load(c, "module-cli", NULL);
     
     fprintf(stderr, "main: mainloop entry.\n");
index 2387017c96397d737f8af5542f4ba11d6ed214ca..97bf5ef3cb383ebe8ba57a9aaeb755538f42778a 100644 (file)
@@ -8,18 +8,21 @@
   #include "protocol-simple.h"
   #define protocol_free protocol_simple_free
   #define IPV4_PORT 4711
+  #define UNIX_SOCKET "/tmp/polypaudio_simple"
 #else
   #ifdef USE_PROTOCOL_CLI
     #include "protocol-cli.h" 
     #define protocol_new protocol_cli_new
     #define protocol_free protocol_cli_free
     #define IPV4_PORT 4712
+    #define UNIX_SOCKET "/tmp/polypaudio_cli"
   #else
     #ifdef USE_PROTOCOL_NATIVE
       #include "protocol-native.h"
       #define protocol_new protocol_native_new
       #define protocol_free protocol_native_free
       #define IPV4_PORT 4713
+      #define UNIX_SOCKET "/tmp/polypaudio_native"
     #else
       #error "Broken build system"
     #endif
@@ -34,7 +37,7 @@ int module_init(struct core *c, struct module*m) {
     if (!(s = socket_server_new_ipv4(c->mainloop, INADDR_LOOPBACK, IPV4_PORT)))
         return -1;
 #else
-    if (!(s = socket_server_new_unix(c->mainloop, "/tmp/polypsimple")))
+    if (!(s = socket_server_new_unix(c->mainloop, UNIX_SOCKET)))
         return -1;
 #endif
 
index 48b6639d2ba96ee939d48580d5c38d31d2f3428a..15f4b1b50e5fb675051c3d9254edb2e0a09b8325 100644 (file)
@@ -46,6 +46,7 @@ struct pdispatch* pdispatch_new(struct pa_mainloop_api *mainloop, const struct p
     pd->mainloop = mainloop;
     pd->command_table = table;
     pd->n_commands = entries;
+    pd->replies = NULL;
     return pd;
 }
 
index a373841a3409c4bc8e00816d89898e5a6fcd8e33..69b85c210a81f1713ad50bce118064e759d9438a 100644 (file)
@@ -15,7 +15,7 @@
 #define DEFAULT_MAX_LENGTH 20480
 #define DEFAULT_PREBUF 4096
 #define DEFAULT_TIMEOUT 5
-#define DEFAULT_SERVER "/tmp/foo"
+#define DEFAULT_SERVER "/tmp/polypaudio_native"
 
 struct pa_context {
     char *name;
index 42859392cae3a9eebae60b9f9f03d47fc158c12c..b10f8ab1a6d3228b276c7d5dc445f3f27323dc14 100644 (file)
@@ -101,7 +101,7 @@ static int do_connect(struct socket_client *c, const struct sockaddr *sa, sockle
         assert(c->io_source);
     } else {
         c->fixed_source = c->mainloop->source_fixed(c->mainloop, connect_fixed_cb, c);
-        assert(c->io_source);
+        assert(c->fixed_source);
     }
 
     return 0;
index 47e17839bf840c6356c2cb094013b8b4015cbbd4..407440d359e17123d1339d676917da39b08d48b2 100644 (file)
@@ -34,7 +34,7 @@ struct tagstruct *tagstruct_new(const uint8_t* data, size_t length) {
     t->data = (uint8_t*) data;
     t->allocated = t->length = data ? length : 0;
     t->rindex = 0;
-    t->dynamic = !!data;
+    t->dynamic = !data;
     return t;
 }
     
@@ -57,7 +57,7 @@ uint8_t* tagstruct_free_data(struct tagstruct*t, size_t *l) {
 static void extend(struct tagstruct*t, size_t l) {
     assert(t && t->dynamic);
 
-    if (t->allocated <= l)
+    if (l <= t->allocated)
         return;
 
     t->data = realloc(t->data, t->allocated = l+100);
@@ -75,7 +75,7 @@ void tagstruct_puts(struct tagstruct*t, const char *s) {
 }
 
 void tagstruct_putu32(struct tagstruct*t, uint32_t i) {
-    assert(t && i);
+    assert(t);
     extend(t, 5);
     t->data[t->length] = TAG_U32;
     *((uint32_t*) (t->data+t->length+1)) = htonl(i);
@@ -83,7 +83,7 @@ void tagstruct_putu32(struct tagstruct*t, uint32_t i) {
 }
 
 void tagstruct_putu8(struct tagstruct*t, uint8_t c) {
-    assert(t && c);
+    assert(t);
     extend(t, 2);
     t->data[t->length] = TAG_U8;
     *(t->data+t->length+1) = c;