Skip to content

Commit

Permalink
MythPlayer:: Add some missing null pointer checks for the decoder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Kendall committed Mar 14, 2011
1 parent c411f55 commit 96f2ed4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 96f2ed4

Please sign in to comment.