]> git.tue.mpg.de Git - paraslash.git/commitdiff
oggdec: Decode only OGGDEC_OUTPUT_CHUNK_SIZE many bytes per iteration.
authorAndre Noll <maan@systemlinux.org>
Mon, 23 Dec 2013 19:15:39 +0000 (19:15 +0000)
committerAndre Noll <maan@systemlinux.org>
Sun, 9 Mar 2014 14:33:03 +0000 (15:33 +0100)
This avoids buffer underruns on slow hardware and simplifies
ogg_post_select() a bit.

oggdec_filter.c

index f41150f2638c62d4dd48fc23f9705f1dcf94ac4d..fd06cd160ca881df70a1f449b4b316214415c6b8 100644 (file)
@@ -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) {