Skip to content

Commit

Permalink
RingBuffer: Limit readblocksize based upon the default buffer size.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mark Kendall committed Jun 6, 2011
1 parent 97a75d4 commit 941bf05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/ringbuffer.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 941bf05

Please sign in to comment.