return;
btr_merge(btrn, fn->min_iqs);
len = btr_next_buffer(btrn, (char **)&inbuf);
+ len = PARA_MAX(len, (size_t)8192);
consumed = 0;
iqs = btr_get_input_queue_size(btrn);
if (!padd->initialized) {
}
/** 640K ought to be enough for everybody ;) */
-#define BTRN_MAX_PENDING (640 * 1024)
+#define BTRN_MAX_PENDING (96 * 1024)
/**
* Return the current state of a buffer tree node.
return;
btr_merge(btrn, fn->min_iqs);
len = btr_next_buffer(btrn, &inbuffer);
+ /*
+ * Decode at most 8K in one go to give the post_select() functions of
+ * other buffer tree nodes a chance to run. This is necessary to avoid
+ * buffer underruns on slow machines.
+ */
+ len = PARA_MIN(len, (size_t)8192);
mad_stream_buffer(&pmd->stream, (unsigned char *)inbuffer, len);
next_frame:
ret = mad_header_decode(&pmd->frame.header, &pmd->stream);
if (read_ret < 0)
goto out;
btr_add_output(out, read_ret, btrn);
- if (btr_get_output_queue_size(btrn) > 640 * 1024)
+ if (btr_get_output_queue_size(btrn) > 128 * 1024)
return; /* enough data for the moment */
}
out:
}
success:
btr_consume(btrn, converted);
- goto next_buffer;
+ return;
err:
assert(ret < 0);
t->error = ret;