[pulseaudio-discuss] [PATCH 6/9] sink: Create the sink node before creating the monitor source
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Thu Nov 7 18:00:11 CET 2013
The sink node object will be used during the monitor source creation
to figure out whether the monitor source should create a node for
itself.
---
src/pulsecore/sink.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 9350772..9dde8bb 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -348,6 +348,18 @@ pa_sink* pa_sink_new(
if (s->card)
pa_assert_se(pa_idxset_put(s->card->sinks, s, NULL) >= 0);
+ if (data->create_node) {
+ if (!data->node_data.description)
+ pa_node_new_data_set_description(&data->node_data, pa_sink_get_description(s));
+
+ if (!(s->node = pa_node_new(s->core, &data->node_data))) {
+ pa_log("Failed to create a node for sink %s.", s->name);
+ goto fail;
+ }
+
+ s->node->owner = s;
+ }
+
pa_source_new_data_init(&source_data);
pa_source_new_data_set_sample_spec(&source_data, &s->sample_spec);
pa_source_new_data_set_channel_map(&source_data, &s->channel_map);
@@ -377,18 +389,6 @@ pa_sink* pa_sink_new(
pa_source_set_fixed_latency(s->monitor_source, s->thread_info.fixed_latency);
pa_source_set_max_rewind(s->monitor_source, s->thread_info.max_rewind);
- if (data->create_node) {
- if (!data->node_data.description)
- pa_node_new_data_set_description(&data->node_data, pa_sink_get_description(s));
-
- if (!(s->node = pa_node_new(s->core, &data->node_data))) {
- pa_log("Failed to create a node for sink %s.", s->name);
- goto fail;
- }
-
- s->node->owner = s;
- }
-
pt = pa_proplist_to_string_sep(s->proplist, "\n ");
pa_log_info("Created sink %u \"%s\" with sample spec %s and channel map %s\n %s",
s->index,
--
1.8.3.1
More information about the pulseaudio-discuss
mailing list