diff --git a/mythtv/libs/libmythtv/fileringbuffer.cpp b/mythtv/libs/libmythtv/fileringbuffer.cpp
index 2985f57..4b06caa 100644
a
|
b
|
bool FileRingBuffer::OpenFile(const QString &lfilename, uint retry_ms) |
193 | 193 | |
194 | 194 | filename = lfilename; |
195 | 195 | safefilename = lfilename; |
| 196 | oldfile = false; |
196 | 197 | |
197 | 198 | if (remotefile) |
198 | 199 | { |
… |
… |
bool FileRingBuffer::OpenFile(const QString &lfilename, uint retry_ms) |
212 | 213 | |
213 | 214 | if (is_local) |
214 | 215 | { |
| 216 | QFileInfo fi(filename); |
| 217 | oldfile = fi.lastModified().secsTo(QDateTime::currentDateTime()) > 60; |
| 218 | |
215 | 219 | char buf[kReadTestSize]; |
216 | 220 | int lasterror = 0; |
217 | 221 | |
… |
… |
bool FileRingBuffer::OpenFile(const QString &lfilename, uint retry_ms) |
267 | 271 | } |
268 | 272 | while ((uint)openTimer.elapsed() < retry_ms); |
269 | 273 | |
| 274 | oldfile &= (openAttempts == 1); |
| 275 | |
270 | 276 | switch (lasterror) |
271 | 277 | { |
272 | 278 | case 0: |
273 | 279 | { |
274 | | QFileInfo fi(filename); |
275 | | oldfile = fi.lastModified() |
276 | | .secsTo(QDateTime::currentDateTime()) > 60; |
277 | 280 | QString extension = fi.completeSuffix().toLower(); |
278 | 281 | if (is_subtitle_possible(extension)) |
279 | 282 | subtitlefilename = local_sub_filename(fi); |
… |
… |
int FileRingBuffer::safe_read(int fd, void *data, uint sz) |
453 | 456 | tot += ret; |
454 | 457 | } |
455 | 458 | |
456 | | if (oldfile) |
457 | | break; |
458 | | |
459 | 459 | if (ret == 0) // EOF returns 0 |
460 | 460 | { |
| 461 | if (oldfile) |
| 462 | break; |
| 463 | |
461 | 464 | if (tot > 0) |
462 | 465 | break; |
463 | 466 | |
diff --git a/mythtv/libs/libmythtv/ringbuffer.cpp b/mythtv/libs/libmythtv/ringbuffer.cpp
index e3f0a5a..7037643 100644
a
|
b
|
void RingBuffer::run(void) |
843 | 843 | } |
844 | 844 | |
845 | 845 | if (remotefile && livetvchain && livetvchain->HasNext()) |
| 846 | { |
| 847 | LOG(VB_GENERAL, LOG_INFO, LOC + |
| 848 | "Setting remote ringbuffer's oldfile bool."); |
846 | 849 | remotefile->SetTimeout(true); |
| 850 | } |
847 | 851 | |
848 | 852 | LOG(VB_FILE, LOG_DEBUG, LOC + |
849 | 853 | QString("safe_read(...@%1, %2) -- begin") |
… |
… |
void RingBuffer::SetWriteBufferMinWriteSize(int newMinSize) |
1552 | 1556 | void RingBuffer::SetOldFile(bool is_old) |
1553 | 1557 | { |
1554 | 1558 | rwlock.lockForWrite(); |
| 1559 | LOG(VB_GENERAL, LOG_INFO, LOC + QString("SetOldFile(%1)").arg(is_old)); |
1555 | 1560 | oldfile = is_old; |
1556 | 1561 | rwlock.unlock(); |
1557 | 1562 | } |