[pulseaudio-commits] r1575 - /branches/lennart/src/pulsecore/protocol-native.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Aug 4 17:09:48 PDT 2007


Author: lennart
Date: Sun Aug  5 02:09:48 2007
New Revision: 1575

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1575&root=3Dpulseaudio&vi=
ew=3Drev
Log:
initialize method pointers properly

Modified:
    branches/lennart/src/pulsecore/protocol-native.c

Modified: branches/lennart/src/pulsecore/protocol-native.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
protocol-native.c?rev=3D1575&root=3Dpulseaudio&r1=3D1574&r2=3D1575&view=3Dd=
iff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/protocol-native.c (original)
+++ branches/lennart/src/pulsecore/protocol-native.c Sun Aug  5 02:09:48 20=
07
@@ -353,7 +353,7 @@
     pa_assert(length > 0);
 =

     s =3D pa_msgobject_new(upload_stream);
-    c->parent.parent.free =3D upload_stream_free;
+    s->parent.parent.parent.free =3D upload_stream_free;
     s->connection =3D c;
     s->sample_spec =3D *ss;
     s->channel_map =3D *map;
@@ -451,8 +451,8 @@
         return NULL;
 =

     s =3D pa_msgobject_new(record_stream);
-    c->parent.parent.free =3D record_stream_free;
-    c->parent.process_msg =3D record_stream_process_msg;
+    s->parent.parent.free =3D record_stream_free;
+    s->parent.process_msg =3D record_stream_process_msg;
     s->connection =3D c;
     s->source_output =3D source_output;
     s->source_output->push =3D source_output_push_cb;
@@ -630,8 +630,8 @@
         return NULL;
 =

     s =3D pa_msgobject_new(playback_stream);
-    c->parent.parent.free =3D playback_stream_free;
-    c->parent.process_msg =3D playback_stream_process_msg;
+    s->parent.parent.parent.free =3D playback_stream_free;
+    s->parent.parent.process_msg =3D playback_stream_process_msg;
     s->connection =3D c;
     s->syncid =3D syncid;
     s->sink_input =3D sink_input;
@@ -697,7 +697,7 @@
         pa_subscription_free(c->subscription);
 =

     if (c->pstream)
-        pa_pstream_close(c->pstream);
+        pa_pstream_unlink(c->pstream);
 =

     if (c->auth_timeout_event) {
         c->protocol->core->mainloop->time_free(c->auth_timeout_event);
@@ -705,8 +705,8 @@
     }
     =

     pa_assert_se(pa_idxset_remove_by_data(c->protocol->connections, c, NUL=
L) =3D=3D c);
+    c->protocol =3D NULL;
     connection_unref(c);
-    c->protocol =3D NULL;
 }
 =

 static void connection_free(pa_object *o) {
@@ -1933,7 +1933,6 @@
     connection *c =3D CONNECTION(userdata);
 =

     connection_assert_ref(c);
-    pa_assert(t);
 =

     t =3D pa_tagstruct_new(NULL, 0);
     pa_tagstruct_putu32(t, PA_COMMAND_SUBSCRIBE_EVENT);
@@ -2653,9 +2652,8 @@
     connection_assert_ref(c);
 =

     connection_unlink(c);
-/*    pa_log("connection died.");*/
-}
-
+    pa_log_info("connection died.");
+}
 =

 static void pstream_drain_callback(pa_pstream *p, void *userdata) {
     connection *c =3D CONNECTION(userdata);
@@ -2732,7 +2730,6 @@
     c->client->owner =3D p->module;
 =

     c->pstream =3D pa_pstream_new(p->core->mainloop, io, p->core->mempool);
-    pa_assert(c->pstream);
 =

     pa_pstream_set_recieve_packet_callback(c->pstream, pstream_packet_call=
back, c);
     pa_pstream_set_recieve_memblock_callback(c->pstream, pstream_memblock_=
callback, c);
@@ -2740,17 +2737,14 @@
     pa_pstream_set_drain_callback(c->pstream, pstream_drain_callback, c);
 =

     c->pdispatch =3D pa_pdispatch_new(p->core->mainloop, command_table, PA=
_COMMAND_MAX);
-    pa_assert(c->pdispatch);
 =

     c->record_streams =3D pa_idxset_new(NULL, NULL);
     c->output_streams =3D pa_idxset_new(NULL, NULL);
-    pa_assert(c->record_streams && c->output_streams);
 =

     c->rrobin_index =3D PA_IDXSET_INVALID;
     c->subscription =3D NULL;
 =

     pa_idxset_put(p->connections, c, NULL);
-
 =

 #ifdef HAVE_CREDS
     if (pa_iochannel_creds_supported(io))
@@ -2834,7 +2828,6 @@
         goto fail;
 =

     p->connections =3D pa_idxset_new(NULL, NULL);
-    pa_assert(p->connections);
 =

     return p;
 =





More information about the pulseaudio-commits mailing list