sink-input,source-output: Avoid unneccessary rate updates

This makes sure we only call sink/source update_rate() if the stream
being woken up has a sample spec that doesn't match the corresponding
device'.

https://bugs.freedesktop.org/show_bug.cgi?id=49875
This commit is contained in:
Arun Raghavan 2012-05-14 12:21:45 +05:30
parent d85360e65c
commit 8f540c6e76
2 changed files with 4 additions and 2 deletions

View file

@ -553,7 +553,8 @@ static void sink_input_set_state(pa_sink_input *i, pa_sink_input_state_t state)
if (i->state == state)
return;
if (i->state == PA_SINK_INPUT_CORKED && state == PA_SINK_INPUT_RUNNING && pa_sink_used_by(i->sink) == 0) {
if (i->state == PA_SINK_INPUT_CORKED && state == PA_SINK_INPUT_RUNNING && pa_sink_used_by(i->sink) == 0 &&
!pa_sample_spec_equal(&i->sample_spec, &i->sink->sample_spec)) {
/* We were uncorked and the sink was not playing anything -- let's try
* to update the sample rate to avoid resampling */
pa_sink_update_rate(i->sink, i->sample_spec.rate, pa_sink_input_is_passthrough(i));