Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/mythtv/libs/libmythtv/ringbuffer.cpp b/mythtv/libs/libmythtv/ringbuffer.cpp
- index 8dd1a67..70164a4 100644
- --- a/mythtv/libs/libmythtv/ringbuffer.cpp
- +++ b/mythtv/libs/libmythtv/ringbuffer.cpp
- @@ -40,6 +40,7 @@ const int RingBuffer::kDefaultOpenTimeout = 2000; // ms
- const int RingBuffer::kLiveTVOpenTimeout = 10000;
- #define CHUNK 32768 /* readblocksize increments */
- +#define MAXBLOCK (256*1024) // Maximum buffer size
- #define LOC QString("RingBuf(%1): ").arg(filename)
- @@ -376,6 +377,7 @@ void RingBuffer::CalcReadAheadThresh(void)
- readblocksize = rbs;
- else
- readblocksize = max(rbs,readblocksize);
- + readblocksize = min(MAXBLOCK, readblocksize);
- // minumum seconds of buffering before allowing read
- float secs_min = 0.35;
- @@ -820,6 +822,8 @@ void RingBuffer::run(void)
- int old_block_size = readblocksize;
- readblocksize = 3 * readblocksize / 2;
- readblocksize = ((readblocksize+CHUNK-1) / CHUNK) * CHUNK;
- + readblocksize = min(MAXBLOCK, readblocksize);
- +
- LOG(VB_FILE, LOG_INFO, LOC +
- QString("Avg read interval was %1 msec. "
- "%2K -> %3K block size")
- @@ -838,6 +842,7 @@ void RingBuffer::run(void)
- .arg((readblocksize+CHUNK)/1024)
- .arg(readblocksize/1024));
- readtimeavg = 225;
- + readblocksize = min(MAXBLOCK, readblocksize);
- }
- }
- ignore_for_read_timing = (totfree < readblocksize) ? true : false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement