Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/mythtv/libs/libmythtv/ringbuffer.cpp b/mythtv/libs/libmythtv/ringbuffer.cpp
- index 7a5f744..0062c42 100644
- --- a/mythtv/libs/libmythtv/ringbuffer.cpp
- +++ b/mythtv/libs/libmythtv/ringbuffer.cpp
- @@ -504,15 +504,15 @@ long long RingBuffer::Seek(long long pos, int whence, bool has_lock)
- ((SEEK_CUR==whence)?"SEEK_CUR":"SEEK_END"))
- .arg(has_lock?"locked":"unlocked"));
- - if (!has_lock)
- - {
- - rwlock.lockForWrite();
- - }
- -
- long long ret;
- - if (readInternalMode)
- + if (readInternalMode) // reading readInternal is atomic, so no need for locking
- {
- + LOG(VB_PLAYBACK, LOG_ERR, LOC + QString("internal readmode active"));
- + if (!has_lock)
- + {
- + rwlock.lockForWrite();
- + }
- poslock.lockForWrite();
- // only valid for SEEK_SET & SEEK_CUR
- switch (whence)
- @@ -533,6 +533,19 @@ long long RingBuffer::Seek(long long pos, int whence, bool has_lock)
- }
- else
- {
- + LOG(VB_PLAYBACK, LOG_ERR, LOC + QString("internal readmode inactive"));
- + if (dynamic_cast<FileRingBuffer*>(this))
- + {
- + StopReads();
- + }
- + if (!has_lock)
- + {
- + rwlock.lockForWrite();
- + }
- + if (dynamic_cast<FileRingBuffer*>(this))
- + {
- + StartReads();
- + }
- ret = SeekInternal(pos, whence);
- }
Advertisement
Add Comment
Please, Sign In to add comment