summaryrefslogtreecommitdiff
path: root/firmware/target/hosted
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted')
-rw-r--r--firmware/target/hosted/maemo/pcm-gstreamer.c6
-rw-r--r--firmware/target/hosted/sdl/pcm-sdl.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/firmware/target/hosted/maemo/pcm-gstreamer.c b/firmware/target/hosted/maemo/pcm-gstreamer.c
index 10a9d77880..5bca6f2d92 100644
--- a/firmware/target/hosted/maemo/pcm-gstreamer.c
+++ b/firmware/target/hosted/maemo/pcm-gstreamer.c
@@ -427,9 +427,9 @@ void pcm_play_dma_postinit(void)
427 427
428void pcm_set_mixer_volume(int volume) 428void pcm_set_mixer_volume(int volume)
429{ 429{
430 /* gstreamer volume range is from 0.00 to 1.00 */ 430 /* gstreamer volume range is from 0.00 to 1.00
431 gdouble gst_vol = (gdouble)(volume - VOLUME_MIN) / (gdouble)VOLUME_RANGE; 431 * input is -990..0 */
432 432 gdouble gst_vol = 1.0f - (gdouble)volume / -990.0f;
433 g_object_set (G_OBJECT(gst_volume), "volume", gst_vol, NULL); 433 g_object_set (G_OBJECT(gst_volume), "volume", gst_vol, NULL);
434} 434}
435 435
diff --git a/firmware/target/hosted/sdl/pcm-sdl.c b/firmware/target/hosted/sdl/pcm-sdl.c
index 812211288e..beefc7818c 100644
--- a/firmware/target/hosted/sdl/pcm-sdl.c
+++ b/firmware/target/hosted/sdl/pcm-sdl.c
@@ -421,7 +421,9 @@ void pcm_play_dma_postinit(void)
421#ifndef HAVE_SW_VOLUME_CONTROL 421#ifndef HAVE_SW_VOLUME_CONTROL
422void pcm_set_mixer_volume(int volume) 422void pcm_set_mixer_volume(int volume)
423{ 423{
424 sim_volume = volume; 424 int minvol = sound_min(SOUND_VOLUME);
425 int volrange = sound_max(SOUND_VOLUME) - minvol;
426 sim_volume = SDL_MIX_MAXVOLUME * (volume / 10 - minvol) / volrange;
425} 427}
426#endif /* HAVE_SW_VOLUME_CONTROL */ 428#endif /* HAVE_SW_VOLUME_CONTROL */
427 429