Skip to content

Commit

Permalink
Prevent seeking on a DVD when the ringbuffer is waiting for the playe…
Browse files Browse the repository at this point in the history
…r (which was causing a segfault).
  • Loading branch information
peper03 committed Jul 28, 2013
1 parent 6b01d7b commit 12d5b83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp
Expand Up @@ -401,6 +401,16 @@ bool DVDRingBuffer::IsBookmarkAllowed(void)
return GetTotalTimeOfTitle() >= 120;
}

bool DVDRingBuffer::IsSeekingAllowed(void)
{
// Don't allow seeking when the ringbuffer is
// waiting for the player to flush its buffers
// or waiting for the decoder.
return ((m_dvdEvent != DVDNAV_WAIT) &&
(m_dvdEvent != DVDNAV_HOP_CHANNEL) &&
(m_processState != PROCESS_WAIT));
}

void DVDRingBuffer::GetDescForPos(QString &desc)
{
if (m_inMenu)
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/DVD/dvdringbuffer.h
Expand Up @@ -109,6 +109,7 @@ class MTV_PUBLIC DVDRingBuffer : public RingBuffer
uint GetTotalTimeOfTitle(void);
float GetAspectOverride(void) { return m_forcedAspect; }
virtual bool IsBookmarkAllowed(void);
virtual bool IsSeekingAllowed(void);
virtual bool IsStreamed(void) { return true; }
virtual int BestBufferSize(void) { return 2048; }

Expand Down

0 comments on commit 12d5b83

Please sign in to comment.