From 941bf053b14933dc9c9a2daa086354788b46cff6 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Mon, 6 Jun 2011 14:00:08 +0800 Subject: [PATCH] RingBuffer: Limit readblocksize based upon the default buffer size. Now that the frontend RingBuffer can buffer up to 32Mb, large read block sizes lead to read failures in the backend as the block size can exceed the size of the default buffer size. --- mythtv/libs/libmythtv/ringbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythtv/libs/libmythtv/ringbuffer.cpp b/mythtv/libs/libmythtv/ringbuffer.cpp index b0df928523c..f4c3aa94a0c 100644 --- a/mythtv/libs/libmythtv/ringbuffer.cpp +++ b/mythtv/libs/libmythtv/ringbuffer.cpp @@ -765,7 +765,7 @@ void RingBuffer::run(void) (now.tv_usec - lastread.tv_usec) / 1000; readtimeavg = (readtimeavg * 9 + readinterval) / 10; - if (readtimeavg < 150 && (uint)readblocksize < (bufferSize>>2)) + if (readtimeavg < 150 && (uint)readblocksize < (BUFFER_SIZE_MINIMUM >>2)) { int old_block_size = readblocksize; readblocksize = 3 * readblocksize / 2;