diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-12-08 14:18:00 -0800 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2014-02-14 21:36:21 +0530 |
commit | bd0bd9143f8159e5475b1295e30ec026ff0b6fef (patch) | |
tree | 6d56d8719b0e5802d7afe652440f00d96f9960fd /src/pulsecore/protocol-native.c | |
parent | ee1a96499447d0bc3458ab5075d05dbefcee225c (diff) |
protocol-native: Don't enumerate unlinked sinks and sources
This makes sure that there is no window between pa_sink/source_new()
and _put() where enumerating sinks/sources causes an assert (several
calls in sink/source_get_info need a linked sink or source).
Diffstat (limited to 'src/pulsecore/protocol-native.c')
-rw-r--r-- | src/pulsecore/protocol-native.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index 41b4b505a..80e72a894 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -3588,11 +3588,13 @@ static void command_get_info_list(pa_pdispatch *pd, uint32_t command, uint32_t t if (i) { PA_IDXSET_FOREACH(p, i, idx) { - if (command == PA_COMMAND_GET_SINK_INFO_LIST) - sink_fill_tagstruct(c, reply, p); - else if (command == PA_COMMAND_GET_SOURCE_INFO_LIST) - source_fill_tagstruct(c, reply, p); - else if (command == PA_COMMAND_GET_CLIENT_INFO_LIST) + if (command == PA_COMMAND_GET_SINK_INFO_LIST) { + if (PA_SINK_IS_LINKED(((pa_sink *)p)->state)) + sink_fill_tagstruct(c, reply, p); + } else if (command == PA_COMMAND_GET_SOURCE_INFO_LIST) { + if (PA_SOURCE_IS_LINKED(((pa_source *)p)->state)) + source_fill_tagstruct(c, reply, p); + } else if (command == PA_COMMAND_GET_CLIENT_INFO_LIST) client_fill_tagstruct(c, reply, p); else if (command == PA_COMMAND_GET_CARD_INFO_LIST) card_fill_tagstruct(c, reply, p); |