]> code.delx.au - pulseaudio/commitdiff
volume: Decrease PA_VOLUME_MAX to be < 2^31
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Sat, 9 Oct 2010 17:59:51 +0000 (23:29 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Thu, 14 Oct 2010 19:40:00 +0000 (01:10 +0530)
This decrease PA_VOLUME_MAX to be less than 2^31. We want to do this in
order to simplify signed arithmetic when applying software volume
scaling (since the volume can now always be safely treated as a signed
number).

src/pulse/volume.h

index 2f71a62c93ebfd5744054a576482904d4a0b5285..98bbac14a84d6ed40b5487bc2d8300fe58ebf53e 100644 (file)
@@ -113,7 +113,7 @@ typedef uint32_t pa_volume_t;
 #define PA_VOLUME_MUTED ((pa_volume_t) 0U)
 
 /** Maximum valid volume we can store. \since 0.9.15 */
-#define PA_VOLUME_MAX ((pa_volume_t) UINT32_MAX-1)
+#define PA_VOLUME_MAX ((pa_volume_t) UINT32_MAX/2)
 
 /** Special 'invalid' volume. \since 0.9.16 */
 #define PA_VOLUME_INVALID ((pa_volume_t) UINT32_MAX)