Skip to content

Commit

Permalink
More DVD/bluray method consolidation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Kendall committed Jan 20, 2011
1 parent e9b5a7e commit dd95580
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 26 deletions.
17 changes: 4 additions & 13 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -913,19 +913,10 @@ int AvFormatDecoder::OpenFile(RingBuffer *rbuffer, bool novideo,

int ret = FindStreamInfo();

if (ringBuffer->IsDVD())
{
if (!ringBuffer->DVD()->StartFromBeginning())
return -1;
ringBuffer->DVD()->IgnoreStillOrWait(false);
}

if (ringBuffer->IsBD())
{
if (!ringBuffer->BD()->StartFromBeginning())
return -1;
ringBuffer->BD()->IgnoreWaitStates(false);
}
// Reset DVD/bluray ringbuffers
if (!ringBuffer->StartFromBeginning())
return -1;
ringBuffer->IgnoreWaitStates(false);

if (ret < 0)
{
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/bdringbuffer.h
Expand Up @@ -54,8 +54,8 @@ class MPUBLIC BDRingBuffer : public RingBuffer
// Player interaction
bool BDWaitingForPlayer(void) { return m_playerWait; }
void SkipBDWaitingForPlayer(void) { m_playerWait = false; }
void IgnoreWaitStates(bool ignore) { m_ignorePlayerWait = ignore; }
bool StartFromBeginning(void);
virtual void IgnoreWaitStates(bool ignore) { m_ignorePlayerWait = ignore; }
virtual bool StartFromBeginning(void);

void ClearOverlays(void);
BDOverlay* GetOverlay(void);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/dvdringbuffer.h
Expand Up @@ -90,7 +90,7 @@ class MPUBLIC DVDRingBuffer : public RingBuffer
uint retry_ms = kDefaultOpenTimeout);
void PlayTitleAndPart(int _title, int _part)
{ dvdnav_part_play(m_dvdnav, _title, _part); }
bool StartFromBeginning(void);
virtual bool StartFromBeginning(void);
void CloseDVD(void);
bool nextTrack(void);
void prevTrack(void);
Expand All @@ -104,7 +104,7 @@ class MPUBLIC DVDRingBuffer : public RingBuffer
void GoToNextProgram(void);
void GoToPreviousProgram(void);

void IgnoreStillOrWait(bool skip) { m_skipstillorwait = skip; }
virtual void IgnoreWaitStates(bool ignore) { m_skipstillorwait = ignore; }
void AudioStreamsChanged(bool change) { m_audioStreamsChanged = change; }
uint GetCurrentTime(void) { return (m_currentTime / 90000); }
uint TitleTimeLeft(void);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/mythdvdplayer.cpp
Expand Up @@ -270,7 +270,7 @@ void MythDVDPlayer::EventLoop(void)

void MythDVDPlayer::InitialSeek(void)
{
player_ctx->buffer->DVD()->IgnoreStillOrWait(true);
player_ctx->buffer->IgnoreWaitStates(true);
if (m_initial_title > -1)
player_ctx->buffer->DVD()->PlayTitleAndPart(m_initial_title, 1);

Expand All @@ -292,7 +292,7 @@ void MythDVDPlayer::InitialSeek(void)
usleep(50000);
}
MythPlayer::InitialSeek();
player_ctx->buffer->DVD()->IgnoreStillOrWait(false);
player_ctx->buffer->IgnoreWaitStates(false);
}

void MythDVDPlayer::ResetPlaying(bool resetframes)
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/ringbuffer.h
Expand Up @@ -64,7 +64,8 @@ class MPUBLIC RingBuffer : protected QThread
const BDRingBuffer *BD(void) const;
DVDRingBuffer *DVD(void);
BDRingBuffer *BD(void);

virtual bool StartFromBeginning(void) { return true; }
virtual void IgnoreWaitStates(bool ignore) { }
virtual bool IsInDiscMenuOrStillFrame(void) const { return false; }
virtual bool HandleAction(const QStringList &, int64_t) { return false; }

Expand Down
8 changes: 2 additions & 6 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -2300,12 +2300,8 @@ void TV::StopStuff(PlayerContext *mctx, PlayerContext *ctx,

SetActive(mctx, 0, false);

if (ctx->buffer && ctx->buffer->IsDVD())
{
VERBOSE(VB_PLAYBACK,LOC + " StopStuff() -- "
"get dvd player out of still frame or wait status");
ctx->buffer->DVD()->IgnoreStillOrWait(true);
}
if (ctx->buffer)
ctx->buffer->IgnoreWaitStates(true);

ctx->LockDeletePlayer(__FILE__, __LINE__);
if (stopPlayer)
Expand Down

0 comments on commit dd95580

Please sign in to comment.