]> git.sesse.net Git - vlc/commitdiff
* modules/audio_output/waveout.c: get rid of roundf() which isn't supported on WinCE.
authorGildas Bazin <gbazin@videolan.org>
Sat, 30 Jul 2005 11:30:51 +0000 (11:30 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 30 Jul 2005 11:30:51 +0000 (11:30 +0000)
modules/audio_output/waveout.c

index 86ff0107f005572d706acb7afcd54baa7f0cb4ac..306af9ab94595b9ad43269d31d5a4da89ff56b44 100644 (file)
@@ -26,7 +26,6 @@
  *****************************************************************************/
 #include <string.h>                                            /* strerror() */
 #include <stdlib.h>                            /* calloc(), malloc(), free() */
-#include <math.h>                                                /* roundf() */
 
 #include <vlc/vlc.h>
 #include <vlc/aout.h>
@@ -801,11 +800,8 @@ static int VolumeGet( aout_instance_t * p_aout, audio_volume_t * pi_volume )
 #endif
 
     i_waveout_vol &= 0xFFFF;
-    /* Force float computation, otherwise VolumeGet does not return the value
-     * which was set with VolumeSet, because of rounding issues */
     *pi_volume = p_aout->output.i_volume =
-        (audio_volume_t)roundf((float)i_waveout_vol * AOUT_VOLUME_MAX
-                               / 2.0 / 0xFFFF);
+        (i_waveout_vol * AOUT_VOLUME_MAX + 0xFFFF /*rounding*/) / 2 / 0xFFFF;
     return 0;
 }