diff options
Diffstat (limited to 'firmware/drivers/audio/sdl.c')
-rw-r--r-- | firmware/drivers/audio/sdl.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c index c14ba0c583..f35cec8cb7 100644 --- a/firmware/drivers/audio/sdl.c +++ b/firmware/drivers/audio/sdl.c | |||
@@ -23,6 +23,12 @@ | |||
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "sound.h" | 24 | #include "sound.h" |
25 | #include "pcm_sampr.h" | 25 | #include "pcm_sampr.h" |
26 | #if CONFIG_CODEC == SWCODEC | ||
27 | #include "fixedpoint.h" | ||
28 | #ifdef HAVE_SW_VOLUME_CONTROL | ||
29 | #include "pcm_sw_volume.h" | ||
30 | #endif | ||
31 | #endif | ||
26 | 32 | ||
27 | /** | 33 | /** |
28 | * Audio Hardware api. Make them do nothing as we cannot properly simulate with | 34 | * Audio Hardware api. Make them do nothing as we cannot properly simulate with |
@@ -30,8 +36,6 @@ | |||
30 | **/ | 36 | **/ |
31 | 37 | ||
32 | #ifdef HAVE_SW_VOLUME_CONTROL | 38 | #ifdef HAVE_SW_VOLUME_CONTROL |
33 | #include "pcm_sw_volume.h" | ||
34 | |||
35 | void audiohw_set_volume(int vol_l, int vol_r) | 39 | void audiohw_set_volume(int vol_l, int vol_r) |
36 | { | 40 | { |
37 | pcm_set_master_volume(vol_l, vol_r); | 41 | pcm_set_master_volume(vol_l, vol_r); |
@@ -39,21 +43,13 @@ void audiohw_set_volume(int vol_l, int vol_r) | |||
39 | 43 | ||
40 | #else /* ndef HAVE_SW_VOLUME_CONTROL */ | 44 | #else /* ndef HAVE_SW_VOLUME_CONTROL */ |
41 | 45 | ||
42 | extern void pcm_set_mixer_volume(int); | ||
43 | 46 | ||
44 | void audiohw_set_volume(int volume) | 47 | void audiohw_set_volume(int volume) |
45 | { | 48 | { |
46 | #if CONFIG_CODEC == SWCODEC | 49 | #if CONFIG_CODEC == SWCODEC |
47 | #if !(CONFIG_PLATFORM & PLATFORM_MAEMO5) | 50 | extern void pcm_set_mixer_volume(int volume); |
48 | if (volume < VOLUME_MIN) | ||
49 | volume = 0; | ||
50 | else | ||
51 | volume = SDL_MIX_MAXVOLUME * (volume - VOLUME_MIN + ONE_DB) / | ||
52 | (VOLUME_RANGE + ONE_DB); | ||
53 | #endif /* !(CONFIG_PLATFORM & PLATFORM_MAEMO5) */ | ||
54 | |||
55 | pcm_set_mixer_volume(volume); | 51 | pcm_set_mixer_volume(volume); |
56 | #endif /* CONFIG_CODEC == SWCODEC */ | 52 | #endif |
57 | (void)volume; | 53 | (void)volume; |
58 | } | 54 | } |
59 | #endif /* HAVE_SW_VOLUME_CONTROL */ | 55 | #endif /* HAVE_SW_VOLUME_CONTROL */ |