Skip to content

Commit

Permalink
Don't use the PLAYBACK_START/PLAYBACK_END events to pause the idle ti…
Browse files Browse the repository at this point in the history
…mer, the problem is that MythMusic unpauses the timer when it recieves the PLAYBACK_START event because it's just stopped music playback. There's no simple way around this if we continue to use the events, so just call PauseIdleTimer() directly instead. Refs #10467
  • Loading branch information
stuartm committed Mar 17, 2012
1 parent 72d3fb5 commit 85ac156
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 3 additions & 0 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -298,13 +298,15 @@ bool TV::StartTV(ProgramInfo *tvrec, uint flags)
// Must be before Init() otherwise we swallow the PLAYBACK_START event
// with the event filter
sendPlaybackStart();
GetMythMainWindow()->PauseIdleTimer(true);

// Initialize TV
if (!tv->Init())
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Failed initializing TV");
ReleaseTV(tv);
sendPlaybackEnd();
GetMythMainWindow()->PauseIdleTimer(false);
delete curProgram;
return false;
}
Expand Down Expand Up @@ -454,6 +456,7 @@ bool TV::StartTV(ProgramInfo *tvrec, uint flags)
}

sendPlaybackEnd();
GetMythMainWindow()->PauseIdleTimer(true);

LOG(VB_PLAYBACK, LOG_INFO, LOC + "StartTV -- end");

Expand Down
8 changes: 0 additions & 8 deletions mythtv/libs/libmythui/mythmainwindow.cpp
Expand Up @@ -2363,14 +2363,6 @@ void MythMainWindow::customEvent(QEvent *ce)
state.insert("currentlocation", GetMythUI()->GetCurrentLocation());
MythUIStateTracker::SetState(state);
}
else if (message.startsWith("PLAYBACK_START"))
{
PauseIdleTimer(true);
}
else if (message.startsWith("PLAYBACK_END"))
{
PauseIdleTimer(false);
}
}
else if ((MythEvent::Type)(ce->type()) == MythEvent::MythUserMessage)
{
Expand Down
2 changes: 2 additions & 0 deletions mythtv/programs/mythfrontend/main.cpp
Expand Up @@ -727,8 +727,10 @@ static void playDisc()
command_string.replace(QRegExp("%d"), dvd_device);
}
sendPlaybackStart();
GetMythMainWindow()->PauseIdleTimer(true);
myth_system(command_string);
sendPlaybackEnd();
GetMythMainWindow()->PauseIdleTimer(false);
if (GetMythMainWindow())
{
GetMythMainWindow()->raise();
Expand Down
2 changes: 2 additions & 0 deletions mythtv/programs/mythfrontend/videoplayercommand.cpp
Expand Up @@ -153,8 +153,10 @@ class VideoPlayMythSystem : public VideoPlayProc
bool Play() const
{
sendPlaybackStart();
GetMythMainWindow()->PauseIdleTimer(true);
myth_system(m_play_command);
sendPlaybackEnd();
GetMythMainWindow()->PauseIdleTimer(false);

return true;
}
Expand Down

0 comments on commit 85ac156

Please sign in to comment.