[pulseaudio-commits] r1900 - in /branches/lennart/src/pulsecore: core.h sink-input.c source-output.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Sep 24 16:31:22 PDT 2007


Author: lennart
Date: Tue Sep 25 01:31:22 2007
New Revision: 1900

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1900&root=pulseaudio&view=rev
Log:
* add new state changed hook for streams
* update sink->n_corked properly when moving streams

Modified:
    branches/lennart/src/pulsecore/core.h
    branches/lennart/src/pulsecore/sink-input.c
    branches/lennart/src/pulsecore/source-output.c

Modified: branches/lennart/src/pulsecore/core.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/core.h?rev=1900&root=pulseaudio&r1=1899&r2=1900&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/core.h (original)
+++ branches/lennart/src/pulsecore/core.h Tue Sep 25 01:31:22 2007
@@ -60,6 +60,7 @@
     PA_CORE_HOOK_SINK_INPUT_MOVE,
     PA_CORE_HOOK_SINK_INPUT_MOVE_POST,
     PA_CORE_HOOK_SINK_INPUT_NAME_CHANGED,
+    PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED,
     PA_CORE_HOOK_SOURCE_OUTPUT_NEW,
     PA_CORE_HOOK_SOURCE_OUTPUT_PUT,
     PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK,
@@ -67,6 +68,7 @@
     PA_CORE_HOOK_SOURCE_OUTPUT_MOVE,
     PA_CORE_HOOK_SOURCE_OUTPUT_MOVE_POST,
     PA_CORE_HOOK_SOURCE_OUTPUT_NAME_CHANGED,
+    PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED,
     PA_CORE_HOOK_MAX
 } pa_core_hook_t;
 

Modified: branches/lennart/src/pulsecore/sink-input.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/sink-input.c?rev=1900&root=pulseaudio&r1=1899&r2=1900&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/sink-input.c (original)
+++ branches/lennart/src/pulsecore/sink-input.c Tue Sep 25 01:31:22 2007
@@ -262,6 +262,9 @@
         ssync->state = state;
     }
 
+    if (state != PA_SINK_INPUT_UNLINKED)
+        pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED], i);
+
     return 0;
 }
 
@@ -825,6 +828,11 @@
     pa_idxset_put(dest->inputs, i, NULL);
     i->sink = dest;
 
+    if (pa_sink_input_get_state(i) == PA_SINK_INPUT_CORKED) {
+        pa_assert_se(origin->n_corked-- >= 1);
+        dest->n_corked++;
+    }
+
     /* Replace resampler */
     if (new_resampler != i->thread_info.resampler) {
         if (i->thread_info.resampler)

Modified: branches/lennart/src/pulsecore/source-output.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/source-output.c?rev=1900&root=pulseaudio&r1=1899&r2=1900&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/source-output.c (original)
+++ branches/lennart/src/pulsecore/source-output.c Tue Sep 25 01:31:22 2007
@@ -192,6 +192,9 @@
 
     o->state = state;
 
+    if (state != PA_SOURCE_OUTPUT_UNLINKED)
+        pa_hook_fire(&o->source->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], o);
+
     return 0;
 }
 
@@ -427,6 +430,11 @@
     pa_idxset_put(dest->outputs, o, NULL);
     o->source = dest;
 
+    if (pa_source_output_get_state(o) == PA_SOURCE_OUTPUT_CORKED) {
+        pa_assert_se(origin->n_corked-- >= 1);
+        dest->n_corked++;
+    }
+
     /* Replace resampler */
     if (new_resampler != o->thread_info.resampler) {
         if (o->thread_info.resampler)




More information about the pulseaudio-commits mailing list