[pulseaudio-commits] r2328 - /branches/glitch-free/src/pulse/operation.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu May 1 12:26:42 PDT 2008


Author: lennart
Date: Thu May  1 21:26:41 2008
New Revision: 2328

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2328&root=pulseaudio&view=rev
Log:
move unlinking code to operation_unlink()

Modified:
    branches/glitch-free/src/pulse/operation.c

Modified: branches/glitch-free/src/pulse/operation.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulse/operation.c?rev=2328&root=pulseaudio&r1=2327&r2=2328&view=diff
==============================================================================
--- branches/glitch-free/src/pulse/operation.c (original)
+++ branches/glitch-free/src/pulse/operation.c Thu May  1 21:26:41 2008
@@ -77,6 +77,23 @@
     }
 }
 
+static void operation_unlink(pa_operation *o) {
+    pa_assert(o);
+
+    if (o->context) {
+        pa_assert(PA_REFCNT_VALUE(o) >= 2);
+
+        PA_LLIST_REMOVE(pa_operation, o->context->operations, o);
+        pa_operation_unref(o);
+
+        o->context = NULL;
+    }
+
+    o->stream = NULL;
+    o->callback = NULL;
+    o->userdata = NULL;
+}
+
 static void operation_set_state(pa_operation *o, pa_operation_state_t st) {
     pa_assert(o);
     pa_assert(PA_REFCNT_VALUE(o) >= 1);
@@ -88,20 +105,8 @@
 
     o->state = st;
 
-    if ((o->state == PA_OPERATION_DONE) || (o->state == PA_OPERATION_CANCELED)) {
-
-        if (o->context) {
-            pa_assert(PA_REFCNT_VALUE(o) >= 2);
-
-            PA_LLIST_REMOVE(pa_operation, o->context->operations, o);
-            pa_operation_unref(o);
-        }
-
-        o->context = NULL;
-        o->stream = NULL;
-        o->callback = NULL;
-        o->userdata = NULL;
-    }
+    if ((o->state == PA_OPERATION_DONE) || (o->state == PA_OPERATION_CANCELED))
+        operation_unlink(o);
 
     pa_operation_unref(o);
 }




More information about the pulseaudio-commits mailing list