summaryrefslogtreecommitdiffstats
path: root/src/pulse/scache.c
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2010-10-09 22:30:20 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2010-10-15 01:10:00 +0530
commit1d2ef7923d28a74e08a4309b6fa3d36481d2df3b (patch)
tree50a611811a1408f682ff21500f3f679e429c327a /src/pulse/scache.c
parent4d84a00b495c44a9e348534bf754ace823c9abe8 (diff)
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).
Diffstat (limited to 'src/pulse/scache.c')
-rw-r--r--src/pulse/scache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulse/scache.c b/src/pulse/scache.c
index b2169b6e..cb8d7c59 100644
--- a/src/pulse/scache.c
+++ b/src/pulse/scache.c
@@ -191,7 +191,7 @@ pa_operation *pa_context_play_sample(pa_context *c, const char *name, const char
pa_tagstruct_putu32(t, PA_INVALID_INDEX);
pa_tagstruct_puts(t, dev);
- if (volume == PA_VOLUME_INVALID && c->version < 15)
+ if (!PA_VOLUME_IS_VALID(volume) && c->version < 15)
volume = PA_VOLUME_NORM;
pa_tagstruct_putu32(t, volume);
@@ -232,7 +232,7 @@ pa_operation *pa_context_play_sample_with_proplist(pa_context *c, const char *na
pa_tagstruct_putu32(t, PA_INVALID_INDEX);
pa_tagstruct_puts(t, dev);
- if (volume == PA_VOLUME_INVALID && c->version < 15)
+ if (!PA_VOLUME_IS_VALID(volume) && c->version < 15)
volume = PA_VOLUME_NORM;
pa_tagstruct_putu32(t, volume);