]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_fifo: Replace duplicate code with node_caller_count()
authorTravis Cross <tc@traviscross.com>
Mon, 26 May 2014 18:43:23 +0000 (18:43 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 28 May 2014 01:32:06 +0000 (01:32 +0000)
src/mod/applications/mod_fifo/mod_fifo.c

index 935431c20d6c309ed282ab2b66b3a7a47eeb5e5c..c1a8b27f74dfd0749e525da1525cadf169f2bb1c 100644 (file)
@@ -674,15 +674,13 @@ static switch_status_t caller_read_frame_callback(switch_core_session_t *session
 static switch_status_t consumer_read_frame_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
 {
        fifo_node_t *node, **node_list = (fifo_node_t **) user_data;
-       int x = 0, total = 0, i = 0;
+       int total = 0, i = 0;
 
        for (i = 0;; i++) {
                if (!(node = node_list[i])) {
                        break;
                }
-               for (x = 0; x < MAX_PRI; x++) {
-                       total += fifo_queue_size(node->fifo_list[x]);
-               }
+               total += node_caller_count(node);
        }
 
        if (total) {