mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
fix IDLE vs. RUNNING state handling of sinks/sources when changing cork status for streams
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1899 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
3c75d35dd0
commit
ac86fa1b97
2 changed files with 10 additions and 0 deletions
|
|
@ -233,6 +233,8 @@ static void update_n_corked(pa_sink_input *i, pa_sink_input_state_t state) {
|
|||
pa_assert_se(i->sink->n_corked -- >= 1);
|
||||
else if (i->state != PA_SINK_INPUT_CORKED && state == PA_SINK_INPUT_CORKED)
|
||||
i->sink->n_corked++;
|
||||
|
||||
pa_sink_update_status(i->sink);
|
||||
}
|
||||
|
||||
static int sink_input_set_state(pa_sink_input *i, pa_sink_input_state_t state) {
|
||||
|
|
@ -350,6 +352,9 @@ void pa_sink_input_put(pa_sink_input *i) {
|
|||
i->thread_info.volume = i->volume;
|
||||
i->thread_info.muted = i->muted;
|
||||
|
||||
if (i->state == PA_SINK_INPUT_CORKED)
|
||||
i->sink->n_corked++;
|
||||
|
||||
pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i->sink), PA_SINK_MESSAGE_ADD_INPUT, i, 0, NULL);
|
||||
pa_sink_update_status(i->sink);
|
||||
|
||||
|
|
|
|||
|
|
@ -188,6 +188,8 @@ static int source_output_set_state(pa_source_output *o, pa_source_output_state_t
|
|||
else if (o->state != PA_SOURCE_OUTPUT_CORKED && state == PA_SOURCE_OUTPUT_CORKED)
|
||||
o->source->n_corked++;
|
||||
|
||||
pa_source_update_status(o->source);
|
||||
|
||||
o->state = state;
|
||||
|
||||
return 0;
|
||||
|
|
@ -262,6 +264,9 @@ void pa_source_output_put(pa_source_output *o) {
|
|||
|
||||
o->thread_info.state = o->state = o->flags & PA_SOURCE_OUTPUT_START_CORKED ? PA_SOURCE_OUTPUT_CORKED : PA_SOURCE_OUTPUT_RUNNING;
|
||||
|
||||
if (o->state == PA_SOURCE_OUTPUT_CORKED)
|
||||
o->source->n_corked++;
|
||||
|
||||
pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_ADD_OUTPUT, o, 0, NULL);
|
||||
pa_source_update_status(o->source);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue