summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-02-27 09:20:25 +0000
committerPierre Ossman <ossman@cendio.se>2006-02-27 09:20:25 +0000
commit4756d186ab461322470a57b0f1e8ca5fdd4eb6fb (patch)
tree5fba9059356eac9618468a6f7bcea595c3615d6a /src/modules
parente8b3819ac87e96e6ad3442ca29eaecb1c57efcc4 (diff)
We have both sink and source in this module.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@613 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-solaris.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 12d6719e..9f93f9d8 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -221,17 +221,32 @@ static void sig_callback(pa_mainloop_api *api, pa_signal_event*e, int sig, void
struct userdata *u = userdata;
pa_cvolume old_vol;
- assert(u && u->sink && u->sink->get_hw_volume);
+ assert(u);
do_write(u);
- memcpy(&old_vol, &u->sink->hw_volume, sizeof(pa_cvolume));
- if (u->sink->get_hw_volume(u->sink) < 0)
- return;
- if (memcmp(&old_vol, &u->sink->hw_volume, sizeof(pa_cvolume)) != 0) {
- pa_subscription_post(u->sink->core,
- PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE,
- u->sink->index);
+ if (u->sink) {
+ assert(u->sink->get_hw_volume);
+ memcpy(&old_vol, &u->sink->hw_volume, sizeof(pa_cvolume));
+ if (u->sink->get_hw_volume(u->sink) < 0)
+ return;
+ if (memcmp(&old_vol, &u->sink->hw_volume, sizeof(pa_cvolume)) != 0) {
+ pa_subscription_post(u->sink->core,
+ PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE,
+ u->sink->index);
+ }
+ }
+
+ if (u->source) {
+ assert(u->source->get_hw_volume);
+ memcpy(&old_vol, &u->source->hw_volume, sizeof(pa_cvolume));
+ if (u->source->get_hw_volume(u->source) < 0)
+ return;
+ if (memcmp(&old_vol, &u->source->hw_volume, sizeof(pa_cvolume)) != 0) {
+ pa_subscription_post(u->source->core,
+ PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE,
+ u->source->index);
+ }
}
}