From d96c06ff93493c125b9f4d36655e77d7029ca309 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 14 Feb 2010 22:37:06 +0100 Subject: [PATCH] btr: Rename btr_bytes_pending() and make it public. The oggvorbis decoder needs to know this info, so make it public. As we have already btr_get_input_queue_size() it is natural to rename btr_bytes_pending() to btr_get_output_queue_size(). --- buffer_tree.c | 13 ++++++++----- buffer_tree.h | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/buffer_tree.c b/buffer_tree.c index 2a78959c..45650a24 100644 --- a/buffer_tree.c +++ b/buffer_tree.c @@ -756,12 +756,15 @@ void btr_splice_out_node(struct btr_node *btrn) assert(list_empty(&btrn->children)); } -/* - * Return the size of the largest input queue. +/** + * Return number of queued output bytes of a buffer tree node. + * + * \param btrn The node whose output queue size should be computed. * - * Iterates over all children of the given node. + * This function iterates over all children of the given node and returns the + * size of the largest input queue. */ -static size_t btr_bytes_pending(struct btr_node *btrn) +size_t btr_get_output_queue_size(struct btr_node *btrn) { size_t max_size = 0; struct btr_node *ch; @@ -1103,7 +1106,7 @@ int btr_node_status(struct btr_node *btrn, size_t min_iqs, if (type != BTR_NT_LEAF) { if (btr_no_children(btrn)) return -E_BTR_NO_CHILD; - if (btr_bytes_pending(btrn) > BTRN_MAX_PENDING) + if (btr_get_output_queue_size(btrn) > BTRN_MAX_PENDING) return 0; } if (type != BTR_NT_ROOT) { diff --git a/buffer_tree.h b/buffer_tree.h index f8fed361..8d7a9649 100644 --- a/buffer_tree.h +++ b/buffer_tree.h @@ -180,6 +180,7 @@ void btr_remove_node(struct btr_node *btrn); void btr_free_node(struct btr_node *btrn); void btr_add_output(char *buf, size_t size, struct btr_node *btrn); size_t btr_get_input_queue_size(struct btr_node *btrn); +size_t btr_get_output_queue_size(struct btr_node *btrn); bool btr_no_parent(struct btr_node *btrn); size_t btr_next_buffer(struct btr_node *btrn, char **bufp); void btr_consume(struct btr_node *btrn, size_t numbytes); -- 2.39.2