[pulseaudio-commits] r2289 - in /branches/glitch-free/src/pulse: volume.c volume.h
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Sun Apr 20 16:57:45 PDT 2008
Author: lennart
Date: Mon Apr 21 01:57:44 2008
New Revision: 2289
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2289&root=pulseaudio&view=rev
Log:
improve dB volume calculation
Modified:
branches/glitch-free/src/pulse/volume.c
branches/glitch-free/src/pulse/volume.h
Modified: branches/glitch-free/src/pulse/volume.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulse/volume.c?rev=2289&root=pulseaudio&r1=2288&r2=2289&view=diff
==============================================================================
--- branches/glitch-free/src/pulse/volume.c (original)
+++ branches/glitch-free/src/pulse/volume.c Mon Apr 21 01:57:44 2008
@@ -80,10 +80,10 @@
return pa_sw_volume_from_linear(pa_sw_volume_to_linear(a)* pa_sw_volume_to_linear(b));
}
-#define USER_DECIBEL_RANGE 30
+#define USER_DECIBEL_RANGE 60
pa_volume_t pa_sw_volume_from_dB(double dB) {
- if (dB <= -USER_DECIBEL_RANGE)
+ if (isinf(dB) < 0 || dB <= -USER_DECIBEL_RANGE)
return PA_VOLUME_MUTED;
return (pa_volume_t) ((dB/USER_DECIBEL_RANGE+1)*PA_VOLUME_NORM);
Modified: branches/glitch-free/src/pulse/volume.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulse/volume.h?rev=2289&root=pulseaudio&r1=2288&r2=2289&view=diff
==============================================================================
--- branches/glitch-free/src/pulse/volume.h (original)
+++ branches/glitch-free/src/pulse/volume.h Mon Apr 21 01:57:44 2008
@@ -166,10 +166,10 @@
double pa_sw_volume_to_linear(pa_volume_t v) PA_GCC_CONST;
#ifdef INFINITY
-#define PA_DECIBEL_MININFTY (-INFINITY)
+#define PA_DECIBEL_MININFTY ((double) -INFINITY)
#else
/** This value is used as minus infinity when using pa_volume_{to,from}_dB(). */
-#define PA_DECIBEL_MININFTY (-200)
+#define PA_DECIBEL_MININFTY ((double) -200)
#endif
PA_C_DECL_END
More information about the pulseaudio-commits
mailing list