From 694d9ae83695e54ffbb51acb1db0496c4281f4b4 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 14 Feb 2010 22:58:12 +0100 Subject: [PATCH] oggdec: Fix a thinko in post_select(). The old code broke out of the decoding loop if btr_node_status() returned zero which is true if no more input data is available for decoding or we already have decoded more than 640K. However, in the first case there might still be decoded data available to be passed to the child nodes and we should pass that data as quick as possible to avoid buffer underruns. So call btr_get_output_queue_size() rather than btr_node_status() to detect the second case. --- oggdec_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oggdec_filter.c b/oggdec_filter.c index f14d97c1..2f52d4d4 100644 --- a/oggdec_filter.c +++ b/oggdec_filter.c @@ -243,7 +243,7 @@ static void ogg_post_select(__a_unused struct sched *s, struct task *t) if (read_ret < 0) goto out; btr_add_output(out, read_ret, btrn); - if (btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL) == 0) + if (btr_get_output_queue_size(btrn) > 640 * 1024) return; /* enough data for the moment */ } out: -- 2.39.5