Skip to content

Commit

Permalink
RingBuffer: add back inadvertantly removed code that allows the reada…
Browse files Browse the repository at this point in the history
…head thread to sleep when full.

Backports 2550e26.
  • Loading branch information
tralph committed Aug 17, 2011
1 parent 8028a58 commit 4bc24ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythtv/RingBuffer.cpp
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 4bc24ed

Please sign in to comment.