Permalink
Browse files

RingBuffer: Set the oldfile flag only once per live TV segment.

Refs #10490.
  • Loading branch information...
1 parent ea953d9 commit 2531893d539ceb7158033a5862e9fbd51e01da1d @stichnot stichnot committed Apr 12, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 mythtv/libs/libmythtv/ringbuffer.cpp
@@ -724,6 +724,7 @@ void RingBuffer::run(void)
struct timeval lastread, now;
int readtimeavg = 300;
bool ignore_for_read_timing = true;
+ bool did_set_oldfile = false;
gettimeofday(&lastread, NULL); // this is just to keep gcc happy
@@ -842,8 +843,12 @@ void RingBuffer::run(void)
"Reading enough data to start playback");
}
- if (remotefile && livetvchain && livetvchain->HasNext())
+ if (!did_set_oldfile && remotefile && livetvchain &&
+ livetvchain->HasNext())
+ {
remotefile->SetTimeout(true);
+ did_set_oldfile = true;
+ }
LOG(VB_FILE, LOG_DEBUG, LOC +
QString("safe_read(...@%1, %2) -- begin")
@@ -917,6 +922,7 @@ void RingBuffer::run(void)
{
livetvchain->SwitchToNext(true);
setswitchtonext = true;
+ did_set_oldfile = false;
}
}
else

0 comments on commit 2531893

Please sign in to comment.