diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index eecda52..f9dfc12 100644
--- a/mythtv/libs/libmythtv/tv_play.cpp
+++ b/mythtv/libs/libmythtv/tv_play.cpp
@@ -3590,6 +3590,32 @@ static bool has_action(QString action, const QStringList &actions)
 
 bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
 {
+    QStringList actions;
+    bool handled = GetMythMainWindow()->
+        TranslateKeyPress("TV Playback", e, actions, false);
+    if (handled)
+        LOG(VB_GENERAL, LOG_DEBUG,
+                "ProcessKeypress(): "
+                "TranslateKeyPress() unexpectedly returned true");
+    bool isJumpingToMain = has_action("ESCAPE", actions) &&
+        GetMythMainWindow()->IsExitingToMain();
+    unsigned iterations = 0;
+    // Set a limit on the number of iterations in case pressing escape
+    // repeatedly somehow gets into a loop.
+    const unsigned kMaxIterations = 10;
+    bool result;
+    do {
+        result = ProcessKeypressInternal(actx, e, isJumpingToMain);
+        ++iterations;
+    } while (isJumpingToMain &&
+             exitPlayerTimerId == 0 &&
+             iterations <= kMaxIterations);
+    return result;
+}
+
+bool TV::ProcessKeypressInternal(PlayerContext *actx, QKeyEvent *e,
+                                 bool isJumpingToMain)
+{
     bool ignoreKeys = actx->IsPlayerChangingBuffers();
 #if DEBUG_ACTIONS
     LOG(VB_GENERAL, LOG_DEBUG, LOC + QString("ProcessKeypress() ignoreKeys: %1")
@@ -3625,7 +3651,10 @@ bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
     OSD *osd = GetOSDLock(actx);
     if (osd && osd->DialogVisible())
     {
-        osd->DialogHandleKeypress(e);
+        if (isJumpingToMain)
+            osd->DialogQuit();
+        else
+            osd->DialogHandleKeypress(e);
         handled = true;
     }
     ReturnOSDLock(actx, osd);
@@ -3644,6 +3673,9 @@ bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
             }
             if (has_action("ESCAPE", actions))
             {
+                if (isJumpingToMain)
+                    actx->player->DisableEdit(false);
+                else
                 if (!actx->player->IsCutListSaved(actx))
                     ShowOSDCutpoint(actx, "EXIT_EDIT_MODE");
                 else
diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
index f9d3ac8..22dc38d 100644
--- a/mythtv/libs/libmythtv/tv_play.h
+++ b/mythtv/libs/libmythtv/tv_play.h
@@ -208,6 +208,8 @@ class MTV_PUBLIC TV : public QObject
 
     // Private event handling
     bool ProcessKeypress(PlayerContext*, QKeyEvent *e);
+    bool ProcessKeypressInternal(PlayerContext*, QKeyEvent *e,
+                                 bool isJumpingToMain);
     void ProcessNetworkControlCommand(PlayerContext *, const QString &command);
 
     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/mythtv/programs/mythfrontend/playbackbox.cpp
+++ b/mythtv/programs/mythfrontend/playbackbox.cpp
@@ -2420,7 +2420,8 @@ bool PlaybackBox::Play(
 
     m_playingSomething = false;
 
-    if (inPlaylist && !m_playListPlay.empty())
+    if (inPlaylist && !m_playListPlay.empty() &&
+        !GetMythMainWindow()->IsExitingToMain())
     {
         QCoreApplication::postEvent(
             this, new MythEvent("PLAY_PLAYLIST"));
