[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.12-132-g83b1d7a

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri Oct 3 16:48:16 PDT 2008


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  da4ad5ed01c02f6390c0e4e741734184707f655e (commit)

- Log -----------------------------------------------------------------
83b1d7a... get rid of pa_alsa_volume_divide() since we have pa_sw_volume_divide() now
-----------------------------------------------------------------------

Summary of changes:
 src/modules/alsa-util.c          |   24 ------------------------
 src/modules/alsa-util.h          |    2 --
 src/modules/module-alsa-sink.c   |    2 +-
 src/modules/module-alsa-source.c |    2 +-
 4 files changed, 2 insertions(+), 28 deletions(-)

-----------------------------------------------------------------------

commit 83b1d7a305dfdf0a6958ba28a84cd1a074ca7aff
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Oct 4 01:48:13 2008 +0200

    get rid of pa_alsa_volume_divide() since we have pa_sw_volume_divide() now

diff --git a/src/modules/alsa-util.c b/src/modules/alsa-util.c
index c3eb72f..ffe7795 100644
--- a/src/modules/alsa-util.c
+++ b/src/modules/alsa-util.c
@@ -1109,27 +1109,3 @@ pa_rtpoll_item* pa_alsa_build_pollfd(snd_pcm_t *pcm, pa_rtpoll *rtpoll) {
 
     return item;
 }
-
-pa_cvolume *pa_alsa_volume_divide(pa_cvolume *r, const pa_cvolume *t) {
-    unsigned i;
-
-    pa_assert(r);
-    pa_assert(t);
-    pa_assert(r->channels == t->channels);
-
-    for (i = 0; i < r->channels; i++) {
-        double a, b, c;
-
-        a = pa_sw_volume_to_linear(r->values[i]); /* the hw volume */
-        b = pa_sw_volume_to_linear(t->values[i]); /* the intended volume */
-
-        if (a <= 0)
-            c = 0;
-        else
-            c = b / a;
-
-        r->values[i] = pa_sw_volume_from_linear(c);
-    }
-
-    return r;
-}
diff --git a/src/modules/alsa-util.h b/src/modules/alsa-util.h
index 7991a10..b66adc1 100644
--- a/src/modules/alsa-util.h
+++ b/src/modules/alsa-util.h
@@ -92,6 +92,4 @@ int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents);
 
 pa_rtpoll_item* pa_alsa_build_pollfd(snd_pcm_t *pcm, pa_rtpoll *rtpoll);
 
-pa_cvolume *pa_alsa_volume_divide(pa_cvolume *r, const pa_cvolume *t);
-
 #endif
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index be463bb..c42da36 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -936,7 +936,7 @@ static int sink_set_volume_cb(pa_sink *s) {
 
         /* Match exactly what the user requested by software */
 
-        pa_alsa_volume_divide(&r, &s->volume);
+        pa_sw_cvolume_divide(&r, &s->volume, &r);
         pa_sink_set_soft_volume(s, &r);
 
         pa_log_debug("Requested volume: %s", pa_cvolume_snprint(t, sizeof(t), &s->volume));
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index d5e2170..e1fe4d6 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -881,7 +881,7 @@ static int source_set_volume_cb(pa_source *s) {
 
         /* Match exactly what the user requested by software */
 
-        pa_alsa_volume_divide(&r, &s->volume);
+        pa_sw_cvolume_divide(&r, &s->volume, &r);
         pa_source_set_soft_volume(s, &r);
 
         pa_log_debug("Requested volume: %s", pa_cvolume_snprint(t, sizeof(t), &s->volume));

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list