From a54566f16cf09d6a1e5bbd0da200f66f553556db Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 23 Dec 2013 19:15:39 +0000 Subject: [PATCH] oggdec: Decode only OGGDEC_OUTPUT_CHUNK_SIZE many bytes per iteration. This avoids buffer underruns on slow hardware and simplifies ogg_post_select() a bit. --- oggdec_filter.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/oggdec_filter.c b/oggdec_filter.c index f41150f2..fd06cd16 100644 --- a/oggdec_filter.c +++ b/oggdec_filter.c @@ -236,13 +236,8 @@ static int ogg_post_select(__a_unused struct sched *s, struct task *t) break; fn->min_iqs = 0; have += ret; - if (have < OGGDEC_OUTPUT_CHUNK_SIZE) - continue; - if (btr_get_output_queue_size(btrn) > OGGDEC_MAX_OUTPUT_SIZE) + if (have >= OGGDEC_OUTPUT_CHUNK_SIZE) break; - btr_add_output(buf, have, btrn); - buf = para_malloc(OGGDEC_OUTPUT_CHUNK_SIZE); - have = 0; } pod->have_more = (ret > 0); if (have > 0) { -- 2.39.2