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>
/* We need to resume the audio device here even for
* PA_SINK_INPUT_START_CORKED, since we need the device parameters
/* We need to resume the audio device here even for
* 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))) {
+ if (pa_sink_check_suspend(d->sink) <= 0)
+ restart(d);
+ }
else
d = pa_hashmap_get(u->device_infos, data->source);
else
d = pa_hashmap_get(u->device_infos, data->source);
+ if (pa_source_check_suspend(d->source) <= 0)
+ restart(d);
+ }