summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Ralph <tralph@mythtv.org>2011-08-17 20:58:37 (GMT)
committer Taylor Ralph <tralph@mythtv.org>2011-08-17 20:58:37 (GMT)
commit4bc24ed0c45df59a8d31022ca815b06ebe279989 (patch)
treec9311c20fa3965f8ed6786eae92f42c13cbd3294
parent8028a5875f6a43ec83bff7c775ff2125f1a46a98 (diff)
RingBuffer: add back inadvertantly removed code that allows the readahead thread to sleep when full.
Backports 2550e267ed8afa3b91a1c50d2a14c1b0a2c1d138.
-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 51af10f..0f9fc62 100644
--- a/mythtv/libs/libmythtv/RingBuffer.cpp
+++ b/mythtv/libs/libmythtv/RingBuffer.cpp
@@ -1145,9 +1145,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;
@@ -1164,7 +1166,6 @@ void RingBuffer::run(void)
totfree = ReadBufFree();
}
- const uint KB32 = 32*1024;
int read_return = -1;
if (totfree >= KB32 && !commserror &&
!ateof && !setswitchtonext)