diff options
author | Raman Shyshniou <rommer@ibuffed.com> | 2018-03-20 16:26:20 +0300 |
---|---|---|
committer | Arun Raghavan <arun@arunraghavan.net> | 2018-06-21 06:05:36 +0530 |
commit | 556cdfa1902d9b2b4022f5a6d51813bdf567b17d (patch) | |
tree | 5889f2de2155e2f5024d3814dcfdc9eb27967f5b /src/modules/module-solaris.c | |
parent | de705a0eeaa27a8ac1abdc2625e639340323595a (diff) |
optimize set_state_in_io_thread() callbacks
Source and sink are passed in arguments to set_state_in_io_thread()
callbacks. There is optimal to access them directly.
Diffstat (limited to 'src/modules/module-solaris.c')
-rw-r--r-- | src/modules/module-solaris.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c index ef42b3d9a..240ed855c 100644 --- a/src/modules/module-solaris.c +++ b/src/modules/module-solaris.c @@ -411,7 +411,7 @@ static int sink_set_state_in_io_thread_cb(pa_sink *s, pa_sink_state_t new_state, case PA_SINK_SUSPENDED: - pa_assert(PA_SINK_IS_OPENED(u->sink->thread_info.state)); + pa_assert(PA_SINK_IS_OPENED(s->thread_info.state)); pa_smoother_pause(u->smoother, pa_rtclock_now()); @@ -424,16 +424,16 @@ static int sink_set_state_in_io_thread_cb(pa_sink *s, pa_sink_state_t new_state, case PA_SINK_IDLE: case PA_SINK_RUNNING: - if (u->sink->thread_info.state == PA_SINK_SUSPENDED) { + if (s->thread_info.state == PA_SINK_SUSPENDED) { pa_smoother_resume(u->smoother, pa_rtclock_now(), true); if (!u->source || u->source_suspended) { bool mute; if (unsuspend(u) < 0) return -1; - u->sink->get_volume(u->sink); - if (u->sink->get_mute(u->sink, &mute) >= 0) - pa_sink_set_mute(u->sink, mute, false); + s->get_volume(s); + if (s->get_mute(s, &mute) >= 0) + pa_sink_set_mute(s, mute, false); } u->sink_suspended = false; } @@ -477,7 +477,7 @@ static int source_set_state_in_io_thread_cb(pa_source *s, pa_source_state_t new_ case PA_SOURCE_SUSPENDED: - pa_assert(PA_SOURCE_IS_OPENED(u->source->thread_info.state)); + pa_assert(PA_SOURCE_IS_OPENED(s->thread_info.state)); if (!u->sink || u->sink_suspended) suspend(u); @@ -488,11 +488,11 @@ static int source_set_state_in_io_thread_cb(pa_source *s, pa_source_state_t new_ case PA_SOURCE_IDLE: case PA_SOURCE_RUNNING: - if (u->source->thread_info.state == PA_SOURCE_SUSPENDED) { + if (s->thread_info.state == PA_SOURCE_SUSPENDED) { if (!u->sink || u->sink_suspended) { if (unsuspend(u) < 0) return -1; - u->source->get_volume(u->source); + s->get_volume(s); } u->source_suspended = false; } |