[pulseaudio-commits] r1675 - /branches/lennart/src/utils/pasuspender.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Aug 16 11:26:36 PDT 2007


Author: lennart
Date: Thu Aug 16 20:26:35 2007
New Revision: 1675

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1675&root=3Dpulseaudio&vi=
ew=3Drev
Log:
only suspend device when server is local

Modified:
    branches/lennart/src/utils/pasuspender.c

Modified: branches/lennart/src/utils/pasuspender.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/utils/pasu=
spender.c?rev=3D1675&root=3Dpulseaudio&r1=3D1674&r2=3D1675&view=3Ddiff
=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/utils/pasuspender.c (original)
+++ branches/lennart/src/utils/pasuspender.c Thu Aug 16 20:26:35 2007
@@ -143,8 +143,12 @@
             break;
 =

         case PA_CONTEXT_READY:
-            pa_operation_unref(pa_context_suspend_sink_by_index(c, PA_INVA=
LID_INDEX, 1, suspend_complete, NULL));
-            pa_operation_unref(pa_context_suspend_source_by_index(c, PA_IN=
VALID_INDEX, 1, suspend_complete, NULL));
+            if (pa_context_is_local(c)) {
+                pa_operation_unref(pa_context_suspend_sink_by_index(c, PA_=
INVALID_INDEX, 1, suspend_complete, NULL));
+                pa_operation_unref(pa_context_suspend_source_by_index(c, P=
A_INVALID_INDEX, 1, suspend_complete, NULL));
+            } else
+                start_child();
+            =

             break;
                     =

         case PA_CONTEXT_TERMINATED:
@@ -193,9 +197,12 @@
     }
 =

     if (context) {
-        /* A context is around, so let's resume */
-        pa_operation_unref(pa_context_suspend_sink_by_index(context, PA_IN=
VALID_INDEX, 0, resume_complete, NULL));
-        pa_operation_unref(pa_context_suspend_source_by_index(context, PA_=
INVALID_INDEX, 0, resume_complete, NULL));
+        if (pa_context_is_local(context)) {
+            /* A context is around, so let's resume */
+            pa_operation_unref(pa_context_suspend_sink_by_index(context, P=
A_INVALID_INDEX, 0, resume_complete, NULL));
+            pa_operation_unref(pa_context_suspend_source_by_index(context,=
 PA_INVALID_INDEX, 0, resume_complete, NULL));
+        } else
+            drain();
     } else
         /* Hmm, no context here, so let's terminate right away */
         quit(0);




More information about the pulseaudio-commits mailing list