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

0 comments on commit 2550e26

Please sign in to comment.