summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2011-10-13 17:30:39 +0200
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-10-17 09:51:45 +0530
commitc5050534522e2dd53ede28e4e5071a15937ff9fd (patch)
treefce8e2be5c3ca657adfde73bc99b61e8c728904b
parentb1dabfb95d85da732714c3334ddcc5af5a2b9e59 (diff)
Fix deferred volume not being applied if sink is closed
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-rw-r--r--src/modules/alsa/alsa-sink.c8
-rw-r--r--src/modules/alsa/alsa-source.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 80bd6bac..066f2dd8 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1710,8 +1710,12 @@ static void thread_func(void *userdata) {
if (u->sink->flags & PA_SINK_DEFERRED_VOLUME) {
pa_usec_t volume_sleep;
pa_sink_volume_change_apply(u->sink, &volume_sleep);
- if (volume_sleep > 0)
- rtpoll_sleep = PA_MIN(volume_sleep, rtpoll_sleep);
+ if (volume_sleep > 0) {
+ if (rtpoll_sleep > 0)
+ rtpoll_sleep = PA_MIN(volume_sleep, rtpoll_sleep);
+ else
+ rtpoll_sleep = volume_sleep;
+ }
}
if (rtpoll_sleep > 0)
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 4b3c8b7a..f03b76e2 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1411,8 +1411,12 @@ static void thread_func(void *userdata) {
if (u->source->flags & PA_SOURCE_DEFERRED_VOLUME) {
pa_usec_t volume_sleep;
pa_source_volume_change_apply(u->source, &volume_sleep);
- if (volume_sleep > 0)
- rtpoll_sleep = PA_MIN(volume_sleep, rtpoll_sleep);
+ if (volume_sleep > 0) {
+ if (rtpoll_sleep > 0)
+ rtpoll_sleep = PA_MIN(volume_sleep, rtpoll_sleep);
+ else
+ rtpoll_sleep = volume_sleep;
+ }
}
if (rtpoll_sleep > 0)