[pulseaudio-commits] r1227 - in /trunk/src/modules: module-alsa-sink.c module-alsa-source.c module-combine.c module-esound-sink.c module-oss-mmap.c module-oss.c module-pipe-sink.c module-solaris.c module-waveout.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Aug 12 10:06:06 PDT 2006


Author: lennart
Date: Sat Aug 12 19:06:05 2006
New Revision: 1227

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1227&root=pulseaudio&view=rev
Log:
make use of pa_sink_used_by()/pa_source_used_by() wherever applicable

Modified:
    trunk/src/modules/module-alsa-sink.c
    trunk/src/modules/module-alsa-source.c
    trunk/src/modules/module-combine.c
    trunk/src/modules/module-esound-sink.c
    trunk/src/modules/module-oss-mmap.c
    trunk/src/modules/module-oss.c
    trunk/src/modules/module-pipe-sink.c
    trunk/src/modules/module-solaris.c
    trunk/src/modules/module-waveout.c

Modified: trunk/src/modules/module-alsa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-alsa-sink.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-alsa-sink.c (original)
+++ trunk/src/modules/module-alsa-sink.c Sat Aug 12 19:06:05 2006
@@ -90,9 +90,7 @@
 #define DEFAULT_DEVICE "default"
 
 static void update_usage(struct userdata *u) {
-   pa_module_set_used(u->module,
-                      (u->sink ? pa_idxset_size(u->sink->inputs) : 0) +
-                      (u->sink ? pa_idxset_size(u->sink->monitor_source->outputs) : 0));
+    pa_module_set_used(u->module, u->sink ? pa_sink_used_by(u->sink) : 0);
 }
 
 static void clear_up(struct userdata *u) {

Modified: trunk/src/modules/module-alsa-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-alsa-source.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-alsa-source.c (original)
+++ trunk/src/modules/module-alsa-source.c Sat Aug 12 19:06:05 2006
@@ -91,8 +91,7 @@
 #define DEFAULT_DEVICE "default"
 
 static void update_usage(struct userdata *u) {
-   pa_module_set_used(u->module,
-                      (u->source ? pa_idxset_size(u->source->outputs) : 0));
+   pa_module_set_used(u->module, u->source ? pa_source_used_by(u->source) : 0);
 }
 
 static void clear_up(struct userdata *u) {

Modified: trunk/src/modules/module-combine.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-combine.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-combine.c (original)
+++ trunk/src/modules/module-combine.c Sat Aug 12 19:06:05 2006
@@ -99,11 +99,8 @@
 static void clear_up(struct userdata *u);
 
 static void update_usage(struct userdata *u) {
-    pa_module_set_used(u->module,
-                       (u->sink ? pa_idxset_size(u->sink->inputs) : 0) +
-                       (u->sink ? pa_idxset_size(u->sink->monitor_source->outputs) : 0));
-}
-
+    pa_module_set_used(u->module, u->sink ? pa_sink_used_by(u->sink) : 0);
+}
 
 static void adjust_rates(struct userdata *u) {
     struct output *o;

Modified: trunk/src/modules/module-esound-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-esound-sink.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-esound-sink.c (original)
+++ trunk/src/modules/module-esound-sink.c Sat Aug 12 19:06:05 2006
@@ -142,7 +142,7 @@
             u->write_index = u->write_length = 0;
         }
     } else if (u->state == STATE_RUNNING) {
-        pa_module_set_used(u->module, pa_idxset_size(u->sink->inputs) + pa_idxset_size(u->sink->monitor_source->outputs));
+        pa_module_set_used(u->module, pa_sink_used_by(u->sink));
         
         if (!u->memchunk.length)
             if (pa_sink_render(u->sink, 8192, &u->memchunk) < 0)

Modified: trunk/src/modules/module-oss-mmap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-oss-mmap.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-oss-mmap.c (original)
+++ trunk/src/modules/module-oss-mmap.c Sat Aug 12 19:06:05 2006
@@ -110,10 +110,9 @@
 #define DEFAULT_FRAGSIZE 1024
 
 static void update_usage(struct userdata *u) {
-   pa_module_set_used(u->module,
-                      (u->sink ? pa_idxset_size(u->sink->inputs) : 0) +
-                      (u->sink ? pa_idxset_size(u->sink->monitor_source->outputs) : 0) +
-                      (u->source ? pa_idxset_size(u->source->outputs) : 0));
+   pa_module_set_used(u->module, 
+                      (u->sink ? pa_sink_used_by(u->sink) : 0) +
+                      (u->source ? pa_source_used_by(u->source) : 0));
 }
 
 static void clear_up(struct userdata *u) {

Modified: trunk/src/modules/module-oss.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-oss.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-oss.c (original)
+++ trunk/src/modules/module-oss.c Sat Aug 12 19:06:05 2006
@@ -100,10 +100,9 @@
 #define DEFAULT_DEVICE "/dev/dsp"
 
 static void update_usage(struct userdata *u) {
-   pa_module_set_used(u->module,
-                      (u->sink ? pa_idxset_size(u->sink->inputs) : 0) +
-                      (u->sink ? pa_idxset_size(u->sink->monitor_source->outputs) : 0) +
-                      (u->source ? pa_idxset_size(u->source->outputs) : 0));
+   pa_module_set_used(u->module, 
+                      (u->sink ? pa_sink_used_by(u->sink) : 0) +
+                      (u->source ? pa_source_used_by(u->source) : 0));
 }
 
 static void clear_up(struct userdata *u) {

Modified: trunk/src/modules/module-pipe-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-pipe-sink.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-pipe-sink.c (original)
+++ trunk/src/modules/module-pipe-sink.c Sat Aug 12 19:06:05 2006
@@ -91,7 +91,7 @@
     if (!pa_iochannel_is_writable(u->io))
         return;
 
-    pa_module_set_used(u->module, pa_idxset_size(u->sink->inputs) + pa_idxset_size(u->sink->monitor_source->outputs));
+    pa_module_set_used(u->module, pa_sink_used_by(u->sink));
     
     if (!u->memchunk.length)
         if (pa_sink_render(u->sink, PIPE_BUF, &u->memchunk) < 0)

Modified: trunk/src/modules/module-solaris.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-solaris.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-solaris.c (original)
+++ trunk/src/modules/module-solaris.c Sat Aug 12 19:06:05 2006
@@ -110,9 +110,8 @@
 
 static void update_usage(struct userdata *u) {
    pa_module_set_used(u->module,
-                      (u->sink ? pa_idxset_size(u->sink->inputs) : 0) +
-                      (u->sink ? pa_idxset_size(u->sink->monitor_source->outputs) : 0) +
-                      (u->source ? pa_idxset_size(u->source->outputs) : 0));
+                      (u->sink ? pa_sink_used_by(u->sink) : 0) +
+                      (u->source ? pa_source_used_by(u->source) : 0));
 }
 
 static void do_write(struct userdata *u) {

Modified: trunk/src/modules/module-waveout.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-waveout.c?rev=1227&root=pulseaudio&r1=1226&r2=1227&view=diff
==============================================================================
--- trunk/src/modules/module-waveout.c (original)
+++ trunk/src/modules/module-waveout.c Sat Aug 12 19:06:05 2006
@@ -103,9 +103,8 @@
 
 static void update_usage(struct userdata *u) {
    pa_module_set_used(u->module,
-                      (u->sink ? pa_idxset_size(u->sink->inputs) : 0) +
-                      (u->sink ? pa_idxset_size(u->sink->monitor_source->outputs) : 0) +
-                      (u->source ? pa_idxset_size(u->source->outputs) : 0));
+                      (u->sink ? pa_sink_used_by(u->sink) : 0) +
+                      (u->source ? pa_source_used_by(u->source) : 0));
 }
 
 static void do_write(struct userdata *u)




More information about the pulseaudio-commits mailing list