[polypaudio-commits] r638 - /trunk/src/polyp/stream.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Mar 11 13:26:40 PST 2006


Author: ossman
Date: Sat Mar 11 22:26:40 2006
New Revision: 638

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=638&root=polypaudio&view=rev
Log:
We no longer guarantee that an operation object is returned. Need to tweak
some parts to handle this.

Modified:
    trunk/src/polyp/stream.c

Modified: trunk/src/polyp/stream.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/stream.c?rev=638&root=polypaudio&r1=637&r2=638&view=diff
==============================================================================
--- trunk/src/polyp/stream.c (original)
+++ trunk/src/polyp/stream.c Sat Mar 11 22:26:40 2006
@@ -314,7 +314,10 @@
 /*     pa_log("requesting new ipol data"); */
     
     if (s->state == PA_STREAM_READY && !s->ipol_requested) {
-        pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+        pa_operation *o;
+        o = pa_stream_get_latency_info(s, NULL, NULL);
+        if (o)
+            pa_operation_unref(o);
         s->ipol_requested = 1;
     }
     
@@ -374,7 +377,6 @@
 
     if (s->interpolate) {
         struct timeval tv;
-        pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
 
         pa_gettimeofday(&tv);
         tv.tv_usec += LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
@@ -860,6 +862,7 @@
 
 pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata) {
     pa_operation *o;
+    pa_operation *lo;
     pa_tagstruct *t;
     uint32_t tag;
     
@@ -891,7 +894,9 @@
     pa_pstream_send_tagstruct(s->context->pstream, t);
     pa_pdispatch_register_reply(s->context->pdispatch, tag, DEFAULT_TIMEOUT, pa_stream_simple_ack_callback, o);
 
-    pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+    lo = pa_stream_get_latency_info(s, NULL, NULL);
+    if (lo)
+        pa_operation_unref(lo);
     
     return pa_operation_ref(o);
 }
@@ -921,8 +926,12 @@
 
     PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
     
-    if ((o = stream_send_simple_command(s, s->direction == PA_STREAM_PLAYBACK ? PA_COMMAND_FLUSH_PLAYBACK_STREAM : PA_COMMAND_FLUSH_RECORD_STREAM, cb, userdata)))
-        pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+    if ((o = stream_send_simple_command(s, s->direction == PA_STREAM_PLAYBACK ? PA_COMMAND_FLUSH_PLAYBACK_STREAM : PA_COMMAND_FLUSH_RECORD_STREAM, cb, userdata))) {
+        pa_operation *lo;
+        lo = pa_stream_get_latency_info(s, NULL, NULL);
+        if (lo)
+            pa_operation_unref(lo);
+    }
     
     return o;
 }
@@ -932,8 +941,12 @@
 
     PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
 
-    if ((o = stream_send_simple_command(s, PA_COMMAND_PREBUF_PLAYBACK_STREAM, cb, userdata)))
-        pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+    if ((o = stream_send_simple_command(s, PA_COMMAND_PREBUF_PLAYBACK_STREAM, cb, userdata))) {
+        pa_operation *lo;
+        lo = pa_stream_get_latency_info(s, NULL, NULL);
+        if (lo)
+            pa_operation_unref(lo);
+    }
     
     return o;
 }
@@ -943,8 +956,12 @@
     
     PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
 
-    if ((o = stream_send_simple_command(s, PA_COMMAND_TRIGGER_PLAYBACK_STREAM, cb, userdata)))
-        pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+    if ((o = stream_send_simple_command(s, PA_COMMAND_TRIGGER_PLAYBACK_STREAM, cb, userdata))) {
+        pa_operation *lo;
+        lo = pa_stream_get_latency_info(s, NULL, NULL);
+        if (lo)
+            pa_operation_unref(lo);
+    }
     
     return o;
 }




More information about the pulseaudio-commits mailing list