summaryrefslogtreecommitdiff
path: root/src/pulsecore
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-07-11 20:52:41 -0700
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-07-11 20:52:41 -0700
commitf69cbdbdf7a0416202f882be8a65793fa57783c6 (patch)
tree86f3a97a9fb5c8957819fc2dbd6c29005b2facb1 /src/pulsecore
parent018de50cfdd6d49c4da2943a0c97dd3705a2f6e8 (diff)
protocol-native: Fix invalid assert
For source and sinks, we allow both the index and name to be invalid while introspecting (the default source/sink will be used). This modifies the assert appropriately. Thanks to Drew Ogle <dantealiegri@gmail.com> for reporting and providing a patch.
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/protocol-native.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index f26750de..0fa4f1ad 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -3390,7 +3390,9 @@ static void command_get_info(pa_pdispatch *pd, uint32_t command, uint32_t tag, p
(command == PA_COMMAND_GET_SOURCE_INFO &&
pa_namereg_is_valid_name_or_wildcard(name, PA_NAMEREG_SOURCE)) ||
pa_namereg_is_valid_name(name), tag, PA_ERR_INVALID);
- CHECK_VALIDITY(c->pstream, idx != PA_INVALID_INDEX || name, tag, PA_ERR_INVALID);
+ CHECK_VALIDITY(c->pstream, command == PA_COMMAND_GET_SINK_INFO ||
+ command == PA_COMMAND_GET_SOURCE_INFO ||
+ (idx != PA_INVALID_INDEX || name), tag, PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, idx == PA_INVALID_INDEX || !name, tag, PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, !name || idx == PA_INVALID_INDEX, tag, PA_ERR_INVALID);