Permalink
Browse files

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

  • Loading branch information...
1 parent 40fc454 commit 785ea1b3604f44c05f0f353a5c0edba0b06592d9 Mark Kendall committed Mar 14, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 mythtv/libs/libmythtv/mythplayer.cpp
View
9 mythtv/libs/libmythtv/mythplayer.cpp
@@ -2222,7 +2222,8 @@ void MythPlayer::SwitchToProgram(void)
if (discontinuity || newtype)
{
player_ctx->tvchain->SetProgram(*pginfo);
- decoder->SetProgramInfo(*pginfo);
+ if (decoder)
+ decoder->SetProgramInfo(*pginfo);
player_ctx->buffer->Reset(true);
if (newtype)
@@ -3146,7 +3147,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);
}
@@ -4243,6 +4245,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 785ea1b

Please sign in to comment.