From bcd86ef3d1a58319f07f20f2e60ccb74ee7839db Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Mon, 5 Oct 2020 12:41:04 +0100 Subject: [PATCH] TV: Move pausing/unpausing of idle timer into ctot/dtor --- mythtv/libs/libmythtv/tv_play.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp index eebe5c85c1c..109e036f555 100644 --- a/mythtv/libs/libmythtv/tv_play.cpp +++ b/mythtv/libs/libmythtv/tv_play.cpp @@ -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; @@ -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"); @@ -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"); } @@ -1269,6 +1267,7 @@ TV::~TV() #else m_mainWindow->show(); #endif + m_mainWindow->PauseIdleTimer(false); }