diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index eecda52..f9dfc12 100644
|
a
|
b
|
static bool has_action(QString action, const QStringList &actions)
|
| 3590 | 3590 | |
| 3591 | 3591 | bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) |
| 3592 | 3592 | { |
| | 3593 | QStringList actions; |
| | 3594 | bool handled = GetMythMainWindow()-> |
| | 3595 | TranslateKeyPress("TV Playback", e, actions, false); |
| | 3596 | if (handled) |
| | 3597 | LOG(VB_GENERAL, LOG_DEBUG, |
| | 3598 | "ProcessKeypress(): " |
| | 3599 | "TranslateKeyPress() unexpectedly returned true"); |
| | 3600 | bool isJumpingToMain = has_action("ESCAPE", actions) && |
| | 3601 | GetMythMainWindow()->IsExitingToMain(); |
| | 3602 | unsigned iterations = 0; |
| | 3603 | // Set a limit on the number of iterations in case pressing escape |
| | 3604 | // repeatedly somehow gets into a loop. |
| | 3605 | const unsigned kMaxIterations = 10; |
| | 3606 | bool result; |
| | 3607 | do { |
| | 3608 | result = ProcessKeypressInternal(actx, e, isJumpingToMain); |
| | 3609 | ++iterations; |
| | 3610 | } while (isJumpingToMain && |
| | 3611 | exitPlayerTimerId == 0 && |
| | 3612 | iterations <= kMaxIterations); |
| | 3613 | return result; |
| | 3614 | } |
| | 3615 | |
| | 3616 | bool TV::ProcessKeypressInternal(PlayerContext *actx, QKeyEvent *e, |
| | 3617 | bool isJumpingToMain) |
| | 3618 | { |
| 3593 | 3619 | bool ignoreKeys = actx->IsPlayerChangingBuffers(); |
| 3594 | 3620 | #if DEBUG_ACTIONS |
| 3595 | 3621 | LOG(VB_GENERAL, LOG_DEBUG, LOC + QString("ProcessKeypress() ignoreKeys: %1") |
| … |
… |
bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3625 | 3651 | OSD *osd = GetOSDLock(actx); |
| 3626 | 3652 | if (osd && osd->DialogVisible()) |
| 3627 | 3653 | { |
| 3628 | | osd->DialogHandleKeypress(e); |
| | 3654 | if (isJumpingToMain) |
| | 3655 | osd->DialogQuit(); |
| | 3656 | else |
| | 3657 | osd->DialogHandleKeypress(e); |
| 3629 | 3658 | handled = true; |
| 3630 | 3659 | } |
| 3631 | 3660 | ReturnOSDLock(actx, osd); |
| … |
… |
bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3644 | 3673 | } |
| 3645 | 3674 | if (has_action("ESCAPE", actions)) |
| 3646 | 3675 | { |
| | 3676 | if (isJumpingToMain) |
| | 3677 | actx->player->DisableEdit(false); |
| | 3678 | else |
| 3647 | 3679 | if (!actx->player->IsCutListSaved(actx)) |
| 3648 | 3680 | ShowOSDCutpoint(actx, "EXIT_EDIT_MODE"); |
| 3649 | 3681 | else |
diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
index f9d3ac8..22dc38d 100644
|
a
|
b
|
class MTV_PUBLIC TV : public QObject
|
| 208 | 208 | |
| 209 | 209 | // Private event handling |
| 210 | 210 | bool ProcessKeypress(PlayerContext*, QKeyEvent *e); |
| | 211 | bool ProcessKeypressInternal(PlayerContext*, QKeyEvent *e, |
| | 212 | bool isJumpingToMain); |
| 211 | 213 | void ProcessNetworkControlCommand(PlayerContext *, const QString &command); |
| 212 | 214 | |
| 213 | 215 | bool HandleTrackAction(PlayerContext*, const QString &action); |
diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
index 9f61035..0314763 100644
|
a
|
b
|
bool PlaybackBox::Play(
|
| 2420 | 2420 | |
| 2421 | 2421 | m_playingSomething = false; |
| 2422 | 2422 | |
| 2423 | | if (inPlaylist && !m_playListPlay.empty()) |
| | 2423 | if (inPlaylist && !m_playListPlay.empty() && |
| | 2424 | !GetMythMainWindow()->IsExitingToMain()) |
| 2424 | 2425 | { |
| 2425 | 2426 | QCoreApplication::postEvent( |
| 2426 | 2427 | this, new MythEvent("PLAY_PLAYLIST")); |