mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-07 04:07:06 -05:00
suspend-on-idle: use earlier (safer) hooks for stream unlink notifications
In the "unlink post" hook it's not guaranteed that the stream's old device exists any more, so let's use the "unlink" hook that is safer. For example, module-bluetooth-policy does a card profile change in the source-output "unlink post" hook, which invalidates the source-output's source pointer. When the "unlink" hook is fired, the stream is still linked to its device, which affects the return values of the check_suspend() functions. The unlinked streams should be ignored by the check_suspend() functions, so I had to add extra parameters to those functions.
This commit is contained in:
parent
2250dbfd69
commit
c3393d27a5
5 changed files with 39 additions and 22 deletions
|
|
@ -400,7 +400,11 @@ int pa_source_update_rate(pa_source *s, uint32_t rate, bool passthrough);
|
|||
|
||||
unsigned pa_source_linked_by(pa_source *s); /* Number of connected streams */
|
||||
unsigned pa_source_used_by(pa_source *s); /* Number of connected streams that are not corked */
|
||||
unsigned pa_source_check_suspend(pa_source *s); /* Returns how many streams are active that don't allow suspensions */
|
||||
|
||||
/* Returns how many streams are active that don't allow suspensions. If
|
||||
* "ignore" is non-NULL, that stream is not included in the count. */
|
||||
unsigned pa_source_check_suspend(pa_source *s, pa_source_output *ignore);
|
||||
|
||||
#define pa_source_get_state(s) ((pa_source_state_t) (s)->state)
|
||||
|
||||
/* Moves all inputs away, and stores them in pa_queue */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue