[pulseaudio-commits] r1226 - in /trunk/src/pulsecore: sink.c sink.h source.c source.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Aug 12 09:51:00 PDT 2006


Author: lennart
Date: Sat Aug 12 18:50:58 2006
New Revision: 1226

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1226&root=pulseaudio&view=rev
Log:
add pa_sink_used_by()/pa_source_used_by()

Modified:
    trunk/src/pulsecore/sink.c
    trunk/src/pulsecore/sink.h
    trunk/src/pulsecore/source.c
    trunk/src/pulsecore/source.h

Modified: trunk/src/pulsecore/sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/sink.c?rev=1226&root=pulseaudio&r1=1225&r2=1226&view=diff
==============================================================================
--- trunk/src/pulsecore/sink.c (original)
+++ trunk/src/pulsecore/sink.c Sat Aug 12 18:50:58 2006
@@ -556,3 +556,17 @@
         
     pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
 }
+
+unsigned pa_sink_used_by(pa_sink *s) {
+    unsigned ret;
+
+    assert(s);
+    assert(s->ref >= 1);
+
+    ret = pa_idxset_size(s->inputs);
+
+    if (s->monitor_source)
+        ret += pa_source_used_by(s->monitor_source);
+
+    return ret;
+}

Modified: trunk/src/pulsecore/sink.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/sink.h?rev=1226&root=pulseaudio&r1=1225&r2=1226&view=diff
==============================================================================
--- trunk/src/pulsecore/sink.h (original)
+++ trunk/src/pulsecore/sink.h Sat Aug 12 18:50:58 2006
@@ -103,4 +103,6 @@
 
 void pa_sink_set_description(pa_sink *s, const char *description);
 
+unsigned pa_sink_used_by(pa_sink *s);
+
 #endif

Modified: trunk/src/pulsecore/source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/source.c?rev=1226&root=pulseaudio&r1=1225&r2=1226&view=diff
==============================================================================
--- trunk/src/pulsecore/source.c (original)
+++ trunk/src/pulsecore/source.c Sat Aug 12 18:50:58 2006
@@ -333,3 +333,10 @@
 
     pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
 }
+
+unsigned pa_source_used_by(pa_source *s) {
+    assert(s);
+    assert(s->ref >= 1);
+
+    return pa_idxset_size(s->outputs);
+}

Modified: trunk/src/pulsecore/source.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/source.h?rev=1226&root=pulseaudio&r1=1225&r2=1226&view=diff
==============================================================================
--- trunk/src/pulsecore/source.h (original)
+++ trunk/src/pulsecore/source.h Sat Aug 12 18:50:58 2006
@@ -104,5 +104,5 @@
 
 void pa_source_set_description(pa_source *s, const char *description);
 
-
+unsigned pa_source_used_by(pa_source *s);
 #endif




More information about the pulseaudio-commits mailing list