From 1d2ef7923d28a74e08a4309b6fa3d36481d2df3b Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sat, 9 Oct 2010 22:30:20 +0530 Subject: volume: Use a macro to check if a volume is valid This adds a PA_VOLUME_IS_VALID() macro for checking if a given pa_volume_t is valid. This makes changes to the volume ranges simpler (just change PA_VOLUME_MAX, for example, without needing to modify any other code). --- src/pulsecore/core-scache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/core-scache.c') diff --git a/src/pulsecore/core-scache.c b/src/pulsecore/core-scache.c index 01724191..cd388efe 100644 --- a/src/pulsecore/core-scache.c +++ b/src/pulsecore/core-scache.c @@ -336,12 +336,12 @@ int pa_scache_play_item(pa_core *c, const char *name, pa_sink *sink, pa_volume_t pass_volume = TRUE; - if (e->volume_is_set && volume != PA_VOLUME_INVALID) { + if (e->volume_is_set && !PA_VOLUME_IS_VALID(volume)) { pa_cvolume_set(&r, e->sample_spec.channels, volume); pa_sw_cvolume_multiply(&r, &r, &e->volume); } else if (e->volume_is_set) r = e->volume; - else if (volume != PA_VOLUME_INVALID) + else if (!PA_VOLUME_IS_VALID(volume)) pa_cvolume_set(&r, e->sample_spec.channels, volume); else pass_volume = FALSE; -- cgit