summaryrefslogtreecommitdiff
path: root/src/modules/module-solaris.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2018-03-19 23:11:04 +0200
committerTanu Kaskinen <tanuk@iki.fi>2018-03-20 13:00:44 +0200
commitad0616d4c91de52b7cb69e6222efe96961755482 (patch)
tree98e5efb75eb65f4ea9e5a7d5af91ac88cb78efcf /src/modules/module-solaris.c
parentb2537a8f38ad71e4dee57263310235abdf2b95a4 (diff)
pass pa_suspend_cause_t to set_state_in_io_thread() callbacks
The suspend cause isn't yet used by any of the callbacks. The alsa sink and source will use it to sync the mixer when the SESSION suspend cause is removed. Currently the syncing is done in pa_sink/source_suspend(), and I want to change that, because pa_sink/source_suspend() shouldn't have any alsa specific code.
Diffstat (limited to 'src/modules/module-solaris.c')
-rw-r--r--src/modules/module-solaris.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index e68f2a93d..ef42b3d9a 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -396,12 +396,17 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
}
/* Called from the IO thread. */
-static int sink_set_state_in_io_thread_cb(pa_sink *s, pa_sink_state_t new_state) {
+static int sink_set_state_in_io_thread_cb(pa_sink *s, pa_sink_state_t new_state, pa_suspend_cause_t new_suspend_cause) {
struct userdata *u;
pa_assert(s);
pa_assert_se(u = s->userdata);
+ /* It may be that only the suspend cause is changing, in which case there's
+ * nothing to do. */
+ if (new_state == s->thread_info.state)
+ return 0;
+
switch (new_state) {
case PA_SINK_SUSPENDED:
@@ -457,12 +462,17 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
}
/* Called from the IO thread. */
-static int source_set_state_in_io_thread_cb(pa_source *s, pa_source_state_t new_state) {
+static int source_set_state_in_io_thread_cb(pa_source *s, pa_source_state_t new_state, pa_suspend_cause_t new_suspend_cause) {
struct userdata *u;
pa_assert(s);
pa_assert_se(u = s->userdata);
+ /* It may be that only the suspend cause is changing, in which case there's
+ * nothing to do. */
+ if (new_state == s->thread_info.state)
+ return 0;
+
switch (new_state) {
case PA_SOURCE_SUSPENDED: