[pulseaudio-commits] r1895 - in /branches/lennart/src/pulsecore: cli-text.c sink.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Sep 24 09:24:24 PDT 2007


Author: lennart
Date: Mon Sep 24 18:24:23 2007
New Revision: 1895

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1895&root=pulseaudio&view=rev
Log:
don't count streams using the monitor source in pa_sink_used_by(), because this would disallow suspending a sink ehn an rtp stream is connected

Modified:
    branches/lennart/src/pulsecore/cli-text.c
    branches/lennart/src/pulsecore/sink.c

Modified: branches/lennart/src/pulsecore/cli-text.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/cli-text.c?rev=1895&root=pulseaudio&r1=1894&r2=1895&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/cli-text.c (original)
+++ branches/lennart/src/pulsecore/cli-text.c Mon Sep 24 18:24:23 2007
@@ -119,7 +119,8 @@
             "\tmonitor source: <%u>\n"
             "\tsample spec: <%s>\n"
             "\tchannel map: <%s>\n"
-            "\tused by: <%u>\n",
+            "\tused by: <%u>\n"
+            "\tlinked by: <%u>\n",
             c->default_sink_name && !strcmp(sink->name, c->default_sink_name) ? '*' : ' ',
             sink->index,
             sink->name,
@@ -134,7 +135,8 @@
             sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
             pa_sample_spec_snprint(ss, sizeof(ss), &sink->sample_spec),
             pa_channel_map_snprint(cm, sizeof(cm), &sink->channel_map),
-            pa_sink_used_by(sink));
+            pa_sink_used_by(sink),
+            pa_sink_linked_by(sink));
 
         if (sink->module)
             pa_strbuf_printf(s, "\tmodule: <%u>\n", sink->module->index);
@@ -177,7 +179,8 @@
             "\tlatency: <%0.0f usec>\n"
             "\tsample spec: <%s>\n"
             "\tchannel map: <%s>\n"
-            "\tused by: <%u>\n",
+            "\tused by: <%u>\n"
+            "\tlinked by: <%u>\n",
             c->default_source_name && !strcmp(source->name, c->default_source_name) ? '*' : ' ',
             source->index,
             source->name,
@@ -191,7 +194,8 @@
             (double) pa_source_get_latency(source),
             pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec),
             pa_channel_map_snprint(cm, sizeof(cm), &source->channel_map),
-            pa_source_used_by(source));
+            pa_source_used_by(source),
+            pa_source_linked_by(source));
 
         if (source->monitor_of)
             pa_strbuf_printf(s, "\tmonitor_of: <%u>\n", source->monitor_of->index);

Modified: branches/lennart/src/pulsecore/sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/sink.c?rev=1895&root=pulseaudio&r1=1894&r2=1895&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/sink.c (original)
+++ branches/lennart/src/pulsecore/sink.c Mon Sep 24 18:24:23 2007
@@ -775,8 +775,11 @@
 
     ret = pa_idxset_size(s->inputs);
 
+    /* We add in the number of streams connected to us here. Please
+     * not the asymmmetry to pa_sink_used_by()! */
+
     if (s->monitor_source)
-        ret += pa_source_used_by(s->monitor_source);
+        ret += pa_source_linked_by(s->monitor_source);
 
     return ret;
 }
@@ -788,13 +791,11 @@
     pa_assert(PA_SINK_LINKED(s->state));
 
     ret = pa_idxset_size(s->inputs);
-
     pa_assert(ret >= s->n_corked);
-
     ret -= s->n_corked;
 
-    if (s->monitor_source)
-        ret += pa_source_used_by(s->monitor_source);
+    /* Streams connected to our monitor source do not matter for
+     * pa_sink_used_by()!.*/
 
     return ret;
 }




More information about the pulseaudio-commits mailing list