Permalink
Browse files

RingBuffer: add back inadvertantly removed code that allows the reada…

…head thread to sleep when full.

Backports 2550e26.
  • Loading branch information...
1 parent 8028a58 commit 4bc24ed0c45df59a8d31022ca815b06ebe279989 @tralph tralph committed Aug 17, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 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)

0 comments on commit 4bc24ed

Please sign in to comment.