- if (read_ret <= 0)
- free(out);
- ret = ns;
- if (read_ret == 0 || read_ret == OV_HOLE)
- goto out;
- ret = -E_OGGDEC_BADLINK;
- if (read_ret < 0)
- goto out;
- btr_add_output(out, read_ret, btrn);
- if (btr_get_output_queue_size(btrn) > 128 * 1024)
- return; /* enough data for the moment */
+ if (ret <= 0)
+ 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)
+ break;
+ btr_add_output(buf, have, btrn);
+ buf = para_malloc(OGGDEC_OUTPUT_CHUNK_SIZE);
+ have = 0;