From 2531893d539ceb7158033a5862e9fbd51e01da1d Mon Sep 17 00:00:00 2001 From: Jim Stichnoth Date: Thu, 12 Apr 2012 06:54:52 -0700 Subject: [PATCH] RingBuffer: Set the oldfile flag only once per live TV segment. Refs #10490. --- mythtv/libs/libmythtv/ringbuffer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mythtv/libs/libmythtv/ringbuffer.cpp b/mythtv/libs/libmythtv/ringbuffer.cpp index e3f0a5ac83c..3883de22a85 100644 --- a/mythtv/libs/libmythtv/ringbuffer.cpp +++ b/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