Permalink
Browse files

MythPlayer:: Add some missing null pointer checks for the decoder.

  • Loading branch information...
1 parent c411f55 commit 96f2ed44755a31223be32d0a89c87ff3f22bd4f7 Mark Kendall committed Mar 14, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 mythtv/libs/libmythtv/mythplayer.cpp
@@ -2288,7 +2288,8 @@ void MythPlayer::SwitchToProgram(void)
.arg(newid).arg(GetEof()));
player_ctx->tvchain->SetProgram(*pginfo);
- decoder->SetProgramInfo(*pginfo);
+ if (decoder)
+ decoder->SetProgramInfo(*pginfo);
player_ctx->buffer->Reset(true);
if (OpenFile() < 0)
@@ -3179,7 +3180,8 @@ void MythPlayer::ChangeSpeed(void)
if (skip_changed && videoOutput)
{
videoOutput->SetPrebuffering(ffrew_skip == 1);
- decoder->setExactSeeks(exactseeks && ffrew_skip == 1);
+ if (decoder)
+ decoder->setExactSeeks(exactseeks && ffrew_skip == 1);
if (play_speed != 0.0f && !(last_speed == 0.0f && ffrew_skip == 1))
DoJumpToFrame(framesPlayed + fftime - rewindtime);
}
@@ -4298,6 +4300,9 @@ int MythPlayer::GetSecondsBehind(void) const
void MythPlayer::calcSliderPos(osdInfo &info, bool paddedFields)
{
+ if (!decoder)
+ return;
+
bool islive = false;
int chapter = GetCurrentChapter() + 1;
int title = GetCurrentTitle() + 1;

0 comments on commit 96f2ed4

Please sign in to comment.