summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Ralph <tralph@mythtv.org>2011-08-17 20:50:18 (GMT)
committer Taylor Ralph <tralph@mythtv.org>2011-08-17 20:50:18 (GMT)
commit2550e267ed8afa3b91a1c50d2a14c1b0a2c1d138 (patch)
tree6d56ab02eed7e4cd647688fd0bc7e144f25ac5f8
parentfdff6388d61047f8b96fb8e3cee9f5bec6df8070 (diff)
RingBuffer: add back inadvertantly removed code that allows the readahead thread to sleep when full.
-rw-r--r--mythtv/libs/libmythtv/ringbuffer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/mythtv/libs/libmythtv/ringbuffer.cpp b/mythtv/libs/libmythtv/ringbuffer.cpp
index a9dfa29..1caacef 100644
--- a/mythtv/libs/libmythtv/ringbuffer.cpp
+++ b/mythtv/libs/libmythtv/ringbuffer.cpp
@@ -740,9 +740,11 @@ void RingBuffer::run(void)
long long totfree = ReadBufFree();
+ const uint KB32 = 32*1024;
// These are conditions where we don't want to go through
// the loop if they are true.
- if ((ignorereadpos >= 0) || commserror || stopreads)
+ if (((totfree < KB32) && readsallowed) ||
+ (ignorereadpos >= 0) || commserror || stopreads)
{
ignore_for_read_timing |=
(ignorereadpos >= 0) || commserror || stopreads;
@@ -759,7 +761,6 @@ void RingBuffer::run(void)
totfree = ReadBufFree();
}
- const uint KB32 = 32*1024;
int read_return = -1;
if (totfree >= KB32 && !commserror &&
!ateof && !setswitchtonext)