Skip to content

Commit

Permalink
TV: Move pausing/unpausing of idle timer into ctot/dtor
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Oct 5, 2020
1 parent 38c5949 commit bcd86ef
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -311,14 +311,11 @@ bool TV::StartTV(ProgramInfo* TVRec, uint Flags, const ChannelInfoList& Selectio
curProgram->SetAllowLastPlayPos((Flags & kStartTVAllowLastPlayPos) != 0U);
}

GetMythMainWindow()->PauseIdleTimer(true);

// Initialize TV
if (!tv->Init())
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Failed initializing TV");
AcquireRelease(refs, false);
GetMythMainWindow()->PauseIdleTimer(false);
delete curProgram;
gCoreContext->emitTVPlaybackAborted();
return false;
Expand Down Expand Up @@ -459,8 +456,6 @@ bool TV::StartTV(ProgramInfo* TVRec, uint Flags, const ChannelInfoList& Selectio
ss->AddScreen(dlg);
}

GetMythMainWindow()->PauseIdleTimer(false);

if (startLivetvEventSent)
gCoreContext->SendSystemEvent("LIVETV_ENDED");

Expand Down Expand Up @@ -1024,6 +1019,9 @@ TV::TV(MythMainWindow* MainWindow)
this, SLOT(onApplicationStateChange(Qt::ApplicationState)));
#endif

if (m_mainWindow)
m_mainWindow->PauseIdleTimer(true);

LOG(VB_PLAYBACK, LOG_INFO, LOC + "Finished creating TV object");
}

Expand Down Expand Up @@ -1269,6 +1267,7 @@ TV::~TV()
#else
m_mainWindow->show();
#endif
m_mainWindow->PauseIdleTimer(false);
}


Expand Down

0 comments on commit bcd86ef

Please sign in to comment.