[pulseaudio-commits] src/Makefile.am src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Wed Mar 13 06:21:27 PDT 2013


 src/Makefile.am                  |    2 +-
 src/modules/module-ladspa-sink.c |   29 +----------------------------
 2 files changed, 2 insertions(+), 29 deletions(-)

New commits:
commit 759f82f17d81e38927c030d25370f21b7ce11a06
Author: Tanu Kaskinen <tanuk at iki.fi>
Date:   Mon Jan 21 00:48:08 2013 +0200

    ladspa: Use volume sharing.
    
    The previous volume handling could cause ear damage: by default the
    ladspa sink volume was 100%, and with flat volumes that would cause
    the master sink volume to jump to 100% too.

diff --git a/src/Makefile.am b/src/Makefile.am
index 7685e0c..88e65cc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1596,7 +1596,7 @@ module_remap_source_la_LDFLAGS = $(MODULE_LDFLAGS)
 module_remap_source_la_LIBADD = $(MODULE_LIBADD)
 
 module_ladspa_sink_la_SOURCES = modules/module-ladspa-sink.c modules/ladspa.h
-module_ladspa_sink_la_CFLAGS = -DLADSPA_PATH=\"$(libdir)/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa\" $(AM_CFLAGS)
+module_ladspa_sink_la_CFLAGS = -DLADSPA_PATH=\"$(libdir)/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa\" $(AM_CFLAGS) $(SERVER_CFLAGS)
 module_ladspa_sink_la_LDFLAGS = $(MODULE_LDFLAGS)
 module_ladspa_sink_la_LIBADD = $(MODULE_LIBADD) $(LIBLTDL)
 
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 951cbc1..6a757e4 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -424,20 +424,6 @@ static void sink_update_requested_latency_cb(pa_sink *s) {
 }
 
 /* Called from main context */
-static void sink_set_volume_cb(pa_sink *s) {
-    struct userdata *u;
-
-    pa_sink_assert_ref(s);
-    pa_assert_se(u = s->userdata);
-
-    if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
-            !PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
-        return;
-
-    pa_sink_input_set_volume(u->sink_input, &s->real_volume, s->save_volume, TRUE);
-}
-
-/* Called from main context */
 static void sink_set_mute_cb(pa_sink *s) {
     struct userdata *u;
 
@@ -683,16 +669,6 @@ static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest) {
 }
 
 /* Called from main context */
-static void sink_input_volume_changed_cb(pa_sink_input *i) {
-    struct userdata *u;
-
-    pa_sink_input_assert_ref(i);
-    pa_assert_se(u = i->userdata);
-
-    pa_sink_volume_changed(u->sink, &i->volume);
-}
-
-/* Called from main context */
 static void sink_input_mute_changed_cb(pa_sink_input *i) {
     struct userdata *u;
 
@@ -1262,7 +1238,7 @@ int pa__init(pa_module*m) {
     }
 
     u->sink = pa_sink_new(m->core, &sink_data,
-                          (master->flags & (PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY)));
+                          (master->flags & (PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY)) | PA_SINK_SHARE_VOLUME_WITH_MASTER);
     pa_sink_new_data_done(&sink_data);
 
     if (!u->sink) {
@@ -1274,8 +1250,6 @@ int pa__init(pa_module*m) {
     u->sink->set_state = sink_set_state_cb;
     u->sink->update_requested_latency = sink_update_requested_latency_cb;
     u->sink->request_rewind = sink_request_rewind_cb;
-    pa_sink_enable_decibel_volume(u->sink, TRUE);
-    pa_sink_set_set_volume_callback(u->sink, sink_set_volume_cb);
     pa_sink_set_set_mute_callback(u->sink, sink_set_mute_cb);
     u->sink->userdata = u;
 
@@ -1309,7 +1283,6 @@ int pa__init(pa_module*m) {
     u->sink_input->detach = sink_input_detach_cb;
     u->sink_input->state_change = sink_input_state_change_cb;
     u->sink_input->moving = sink_input_moving_cb;
-    u->sink_input->volume_changed = sink_input_volume_changed_cb;
     u->sink_input->mute_changed = sink_input_mute_changed_cb;
     u->sink_input->userdata = u;
 



More information about the pulseaudio-commits mailing list