summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink-input.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-11-05 22:55:14 +0100
committerLennart Poettering <lennart@poettering.net>2009-11-05 22:58:15 +0100
commitf202af17b717f5b383ac072f80a6c1327bc3143b (patch)
tree05fe877c6714188bc511aa8bc18ccfd65be7229b /src/pulsecore/sink-input.c
parent4d62f159a74c6e5b46be5823483a7dedd5691b45 (diff)
ramping: minor cleanups
Diffstat (limited to 'src/pulsecore/sink-input.c')
-rw-r--r--src/pulsecore/sink-input.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 216edd41..177d330d 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1813,6 +1813,7 @@ void pa_sink_input_set_volume_with_ramping(pa_sink_input *i, const pa_cvolume *v
else
volume = pa_sw_cvolume_multiply_scalar(&v, &v, pa_cvolume_max(volume));
} else {
+
if (!pa_cvolume_compatible(volume, &i->sample_spec)) {
v = i->volume;
volume = pa_cvolume_scale(&v, pa_cvolume_max(volume));
@@ -1866,15 +1867,18 @@ void pa_sink_input_set_volume_with_ramping(pa_sink_input *i, const pa_cvolume *v
void pa_sink_input_set_mute_with_ramping(pa_sink_input *i, pa_bool_t mute, pa_bool_t save, pa_usec_t t){
- pa_assert(i);
pa_sink_input_assert_ref(i);
+ pa_assert_ctl_context();
pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
- if (!i->muted == !mute)
+ if (!i->muted == !mute) {
+ i->save_muted = i->save_muted || mute;
return;
+ }
i->muted = mute;
i->save_muted = save;
+
/* Set this flag before the following code modify i->thread_info.muted, otherwise distortion will be heard */
if (t > 0)
pa_atomic_store(&i->before_ramping_m, 1);
@@ -1884,5 +1888,9 @@ void pa_sink_input_set_mute_with_ramping(pa_sink_input *i, pa_bool_t mute, pa_bo
if (t > 0)
sink_input_set_ramping_info_for_mute(i, mute, t);
+ /* The mute status changed, let's tell people so */
+ if (i->mute_changed)
+ i->mute_changed(i);
+
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
}