diff --git a/mythtv/libs/libmythtv/fileringbuffer.cpp b/mythtv/libs/libmythtv/fileringbuffer.cpp
index 22f42ae..02d3a4f 100644
|
a
|
b
|
static int posix_fadvise(int, off_t, off_t, int) { return 0; }
|
| 42 | 42 | #define LOC_ERR QString("FileRingBuf(%1) Error: ").arg(filename) |
| 43 | 43 | |
| 44 | 44 | FileRingBuffer::FileRingBuffer(const QString &lfilename, |
| 45 | | bool write, bool readahead, int timeout_ms) |
| 46 | | : RingBuffer(kRingBuffer_File) |
| | 45 | bool write, bool readahead, int timeout_ms, |
| | 46 | RingBufferType rbtype) |
| | 47 | : RingBuffer(rbtype) |
| 47 | 48 | { |
| 48 | 49 | startreadahead = readahead; |
| 49 | 50 | safefilename = lfilename; |
diff --git a/mythtv/libs/libmythtv/fileringbuffer.h b/mythtv/libs/libmythtv/fileringbuffer.h
index 93fee9f..b2b97dd 100644
|
a
|
b
|
class MTV_PUBLIC FileRingBuffer : public RingBuffer
|
| 18 | 18 | |
| 19 | 19 | protected: |
| 20 | 20 | FileRingBuffer(const QString &lfilename, |
| 21 | | bool write, bool readahead, int timeout_ms); |
| | 21 | bool write, bool readahead, int timeout_ms, |
| | 22 | RingBufferType rbtype = kRingBuffer_File); |
| 22 | 23 | |
| 23 | 24 | virtual int safe_read(void *data, uint sz) |
| 24 | 25 | { |
diff --git a/mythtv/libs/libmythtv/ringbuffer.cpp b/mythtv/libs/libmythtv/ringbuffer.cpp
index 253c58b..5124848 100644
|
a
|
b
|
RingBuffer *RingBuffer::Create(
|
| 138 | 138 | bddir = true; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | | if (!stream_only && (dvdurl || dvddir || dvdext)) |
| | 141 | bool isdvd = dvdurl || dvddir || dvdext; |
| | 142 | |
| | 143 | if (!stream_only && isdvd) |
| 142 | 144 | { |
| 143 | 145 | if (lfilename.left(6) == "dvd://") // 'Play DVD' sends "dvd:/" + dev |
| 144 | 146 | lfilename.remove(0,5); // e.g. "dvd://dev/sda" |
| … |
… |
RingBuffer *RingBuffer::Create(
|
| 169 | 171 | return new BDRingBuffer(lfilename); |
| 170 | 172 | } |
| 171 | 173 | |
| | 174 | |
| | 175 | RingBufferType type = kRingBuffer_File; |
| | 176 | if (stream_only && isdvd) |
| | 177 | type = kRingBuffer_RemoteDVD; |
| | 178 | |
| 172 | 179 | return new FileRingBuffer( |
| 173 | | lfilename, write, usereadahead, timeout_ms); |
| | 180 | lfilename, write, usereadahead, timeout_ms, type); |
| 174 | 181 | } |
| 175 | 182 | |
| 176 | 183 | RingBuffer::RingBuffer(RingBufferType rbtype) : |
| … |
… |
void RingBuffer::CalcReadAheadThresh(void)
|
| 366 | 373 | // make this a multiple of ffmpeg block size.. |
| 367 | 374 | fill_min = ((fill_min / KB32) + 1) * KB32; |
| 368 | 375 | |
| | 376 | if (type == kRingBuffer_RemoteDVD) |
| | 377 | { |
| | 378 | fill_min = CHUNK; |
| | 379 | readblocksize = CHUNK; |
| | 380 | } |
| | 381 | |
| 369 | 382 | VERBOSE(VB_FILE, LOC + |
| 370 | 383 | QString("CalcReadAheadThresh(%1 Kb)\n\t\t\t -> " |
| 371 | 384 | "threshhold(%2 KB) min read(%3 KB) blk size(%4 KB)") |
| … |
… |
void RingBuffer::run(void)
|
| 772 | 785 | (now.tv_usec - lastread.tv_usec) / 1000; |
| 773 | 786 | readtimeavg = (readtimeavg * 9 + readinterval) / 10; |
| 774 | 787 | |
| 775 | | if (readtimeavg < 150 && (uint)readblocksize < (BUFFER_SIZE_MINIMUM >>2)) |
| | 788 | if (readtimeavg < 150 && |
| | 789 | (uint)readblocksize < (BUFFER_SIZE_MINIMUM >>2) && |
| | 790 | type != kRingBuffer_RemoteDVD) |
| 776 | 791 | { |
| 777 | 792 | int old_block_size = readblocksize; |
| 778 | 793 | readblocksize = 3 * readblocksize / 2; |
diff --git a/mythtv/libs/libmythtv/ringbuffer.h b/mythtv/libs/libmythtv/ringbuffer.h
index 6073c56..29bcad5 100644
|
a
|
b
|
enum RingBufferType
|
| 38 | 38 | kRingBuffer_DVD, |
| 39 | 39 | kRingBuffer_BD, |
| 40 | 40 | kRingBuffer_HTTP, |
| | 41 | kRingBuffer_RemoteDVD, |
| | 42 | kRingBuffer_RemoteBD, |
| 41 | 43 | }; |
| 42 | 44 | |
| 43 | 45 | class MTV_PUBLIC RingBuffer : protected QThread |