Hi ,

Request to rewind due to corking will do nothing because of sink-input's
threadinfo state changed to "PA_SINK_INPUT_CORKED". So the patch mark new
state after finished the rewinding. For uncorking, it's right to set
"PA_SINK_INPUT_RUNNING" state before the rewind happened.

--xingchao
From 3406e4e6e0ae5146d6214e73c352d2bc670decba Mon Sep 17 00:00:00 2001
From: xingchao <[email protected]>
Date: Tue, 21 Jun 2011 12:13:14 -0400
Subject: [PATCH] avoid fake rewind in corked state

sink_input_request_rewind() do nothing if in corked state. there's rewind
request need in pa_sink_input_set_state_within_thread(), so mark CORKING state
after rewinding.
---
 src/pulsecore/sink-input.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index f4f3258..02099ce 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1755,7 +1755,6 @@ void pa_sink_input_set_state_within_thread(pa_sink_input *i, pa_sink_input_state
     if (i->state_change)
         i->state_change(i, state);
 
-    i->thread_info.state = state;
 
     if (corking) {
 
@@ -1764,9 +1763,11 @@ void pa_sink_input_set_state_within_thread(pa_sink_input *i, pa_sink_input_state
         /* This will tell the implementing sink input driver to rewind
          * so that the unplayed already mixed data is not lost */
         pa_sink_input_request_rewind(i, 0, TRUE, TRUE, FALSE);
+    	i->thread_info.state = state;
 
     } else if (uncorking) {
 
+    	i->thread_info.state = state;
         i->thread_info.underrun_for = (uint64_t) -1;
         i->thread_info.playing_for = 0;
 
-- 
1.7.1

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to