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.
This commit is contained in:
Arun Raghavan 2011-07-11 20:52:41 -07:00
parent 018de50cfd
commit f69cbdbdf7

View file

@ -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);