mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
suspend-on-idle: Ensure we still time out if a stream remains corked
If a stream is started corked and remains corked, the sink/source remained idle without being properly suspended. This patch fixes that issue. BugLink: https://bugs.launchpad.net/bugs/1284415 Tested-by: Ricardo Salveti <ricardo.salveti@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
732348c9d9
commit
b55de5179a
1 changed files with 10 additions and 3 deletions
|
|
@ -141,10 +141,14 @@ static pa_hook_result_t sink_input_fixate_hook_cb(pa_core *c, pa_sink_input_new_
|
||||||
|
|
||||||
/* We need to resume the audio device here even for
|
/* We need to resume the audio device here even for
|
||||||
* PA_SINK_INPUT_START_CORKED, since we need the device parameters
|
* PA_SINK_INPUT_START_CORKED, since we need the device parameters
|
||||||
* to be fully available while the stream is set up. */
|
* to be fully available while the stream is set up. In that case,
|
||||||
|
* make sure we close the sink again after the timeout interval. */
|
||||||
|
|
||||||
if ((d = pa_hashmap_get(u->device_infos, data->sink)))
|
if ((d = pa_hashmap_get(u->device_infos, data->sink))) {
|
||||||
resume(d);
|
resume(d);
|
||||||
|
if (pa_sink_check_suspend(d->sink) <= 0)
|
||||||
|
restart(d);
|
||||||
|
}
|
||||||
|
|
||||||
return PA_HOOK_OK;
|
return PA_HOOK_OK;
|
||||||
}
|
}
|
||||||
|
|
@ -161,8 +165,11 @@ static pa_hook_result_t source_output_fixate_hook_cb(pa_core *c, pa_source_outpu
|
||||||
else
|
else
|
||||||
d = pa_hashmap_get(u->device_infos, data->source);
|
d = pa_hashmap_get(u->device_infos, data->source);
|
||||||
|
|
||||||
if (d)
|
if (d) {
|
||||||
resume(d);
|
resume(d);
|
||||||
|
if (pa_source_check_suspend(d->source) <= 0)
|
||||||
|
restart(d);
|
||||||
|
}
|
||||||
|
|
||||||
return PA_HOOK_OK;
|
return PA_HOOK_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue