Skip to content

Commit

Permalink
RingBuffer: Set the oldfile flag only once per live TV segment.
Browse files Browse the repository at this point in the history
Refs #10490.
  • Loading branch information
stichnot committed Apr 12, 2012
1 parent ea953d9 commit 2531893
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mythtv/libs/libmythtv/ringbuffer.cpp
Expand Up @@ -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

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -917,6 +922,7 @@ void RingBuffer::run(void)
{
livetvchain->SwitchToNext(true);
setswitchtonext = true;
did_set_oldfile = false;
}
}
else
Expand Down

0 comments on commit 2531893

Please sign in to comment.