Ticket #13444: 20190417-android-suspend-pause-bookmark.patch

File 20190417-android-suspend-pause-bookmark.patch, 2.8 KB (added by gigem, 8 months ago)
  • mythtv/libs/libmythtv/tv_play.cpp

    diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
    index 740b658b9f..3a4cae514e 100644
    a b void TV::customEvent(QEvent *e) 
    98549854        ReturnOSDLock(mctx, osd);
    98559855        ReturnPlayerLock(mctx);
    98569856    }
     9857
     9858    if (message == "QAPP_SUSPENDED")
     9859    {
     9860        LOG(VB_GENERAL, LOG_NOTICE, "Suspending playback");
     9861        PlayerContext *ctx = GetPlayerReadLock(-1, __FILE__, __LINE__);
     9862        vector<bool> do_pause;
     9863        for (uint i = 0; i < m_player.size(); i++)
     9864            do_pause.push_back(true);
     9865        m_suspendedPause = DoSetPauseState(ctx, do_pause);
     9866        SetBookmark(ctx, false);
     9867        ReturnPlayerLock(ctx);
     9868    }
     9869
     9870    if (message == "QAPP_RESUMED")
     9871    {
     9872        LOG(VB_GENERAL, LOG_NOTICE, "Resuming playback");
     9873        PlayerContext *ctx = GetPlayerReadLock(-1, __FILE__, __LINE__);
     9874        SetBookmark(ctx, true);
     9875        DoSetPauseState(ctx, m_suspendedPause);
     9876        ReturnPlayerLock(ctx);
     9877    }
    98579878}
    98589879
    98599880void TV::QuickRecord(PlayerContext *ctx)
  • mythtv/libs/libmythtv/tv_play.h

    diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
    index 5102810ff5..7c5a6006b1 100644
    a b class MTV_PUBLIC TV : public QObject, public MenuItemDisplayer 
    932932    /// true if video chromakey and frame should not be drawn
    933933    bool          m_disableDrawUnusedRects {false};
    934934
    935     // embedded status
     935    // embedded and suspended status
    936936    bool         m_isEmbedded {false};       ///< are we currently embedded
    937937    bool         m_ignoreKeyPresses {false}; ///< should we ignore keypresses
    938938    vector<bool> m_savedPause;      ///< saved pause state before embedding
     939    vector<bool> m_suspendedPause;  ///< saved pause state before suspending
    939940
    940941    // Channel group stuff
    941942    /// \brief Lock necessary when modifying channel group variables.
  • mythtv/libs/libmythui/mythmainwindow.cpp

    diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp
    index 30027e06a2..22423024e4 100644
    a b void MythMainWindow::onApplicationStateChange(Qt::ApplicationState state) 
    31443144    {
    31453145        case Qt::ApplicationState::ApplicationActive:
    31463146            PopDrawDisabled();
     3147            {
     3148                MythEvent me(MythEvent::MythEventMessage, "QAPP_RESUMED");
     3149                qApp->sendEvent(this, &me);
     3150            }
    31473151            break;
    31483152        case Qt::ApplicationState::ApplicationSuspended:
    31493153            PushDrawDisabled();
     3154            {
     3155                MythEvent me(MythEvent::MythEventMessage, "QAPP_SUSPENDED");
     3156                qApp->sendEvent(this, &me);
     3157            }
    31503158            break;
    31513159        default:
    31523160            break;