diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index bbd5d51..22da98c 100644
--- a/mythtv/libs/libmythtv/tv_play.cpp
+++ b/mythtv/libs/libmythtv/tv_play.cpp
@@ -3412,6 +3412,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")
@@ -3447,7 +3473,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);
@@ -3466,6 +3495,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 247fb03..3a4db3e 100644
--- a/mythtv/libs/libmythtv/tv_play.h
+++ b/mythtv/libs/libmythtv/tv_play.h
@@ -188,6 +188,8 @@ class MPUBLIC TV : public QObject
 
     // User input processing commands
     bool ProcessKeypress(PlayerContext*, QKeyEvent *e);
+    bool ProcessKeypressInternal(PlayerContext*, QKeyEvent *e,
+                                 bool isJumpingToMain);
     void ProcessNetworkControlCommand(PlayerContext *, const QString &command);
     void customEvent(QEvent *e);
     bool event(QEvent *e);
diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
index 7c6b253..baf8f61 100644
--- a/mythtv/programs/mythfrontend/playbackbox.cpp
+++ b/mythtv/programs/mythfrontend/playbackbox.cpp
@@ -2346,7 +2346,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"));
