summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorTanu Kaskinen <ext-tanu.kaskinen@nokia.com>2010-01-08 11:09:25 +0200
committerTanu Kaskinen <ext-tanu.kaskinen@nokia.com>2010-05-10 14:07:12 +0300
commit7bc5cd78454bee5990d29a0ba04482a505a08346 (patch)
tree7a28557eececa0af2b774e185e51950fcf166b51 /src/modules
parent6a5f0ba431a012ccee38c28e222e7258be13d3ea (diff)
alsa: Fix log output to inform about positive base volumes correctly.
Positive base volume can happen, if the alsa volume range has been limited. For example, in an embedded environment it may be known that the sound device is capable of louder output than what the speakers can handle, so setting the max volume below 0 dB makes sense.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/alsa/alsa-sink.c5
-rw-r--r--src/modules/alsa/alsa-source.c5
2 files changed, 2 insertions, 8 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index ce7970b2..35a806c8 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1252,10 +1252,7 @@ static int sink_set_port_cb(pa_sink *s, pa_device_port *p) {
s->base_volume = pa_sw_volume_from_dB(-u->mixer_path->max_dB);
s->n_volume_steps = PA_VOLUME_NORM+1;
- if (u->mixer_path->max_dB > 0.0)
- pa_log_info("Fixing base volume to %0.2f dB", pa_sw_volume_to_dB(s->base_volume));
- else
- pa_log_info("No particular base volume set, fixing to 0 dB");
+ pa_log_info("Fixing base volume to %0.2f dB", pa_sw_volume_to_dB(s->base_volume));
} else {
s->base_volume = PA_VOLUME_NORM;
s->n_volume_steps = u->mixer_path->max_volume - u->mixer_path->min_volume + 1;
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 00810c86..381a7062 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1186,10 +1186,7 @@ static int source_set_port_cb(pa_source *s, pa_device_port *p) {
s->base_volume = pa_sw_volume_from_dB(-u->mixer_path->max_dB);
s->n_volume_steps = PA_VOLUME_NORM+1;
- if (u->mixer_path->max_dB > 0.0)
- pa_log_info("Fixing base volume to %0.2f dB", pa_sw_volume_to_dB(s->base_volume));
- else
- pa_log_info("No particular base volume set, fixing to 0 dB");
+ pa_log_info("Fixing base volume to %0.2f dB", pa_sw_volume_to_dB(s->base_volume));
} else {
s->base_volume = PA_VOLUME_NORM;
s->n_volume_steps = u->mixer_path->max_volume - u->mixer_path->min_volume + 1;