Index: libs/libmythtv/tv_play.cpp
===================================================================
--- libs/libmythtv/tv_play.cpp	(revision 26040)
+++ libs/libmythtv/tv_play.cpp	(working copy)
@@ -3500,6 +3500,22 @@
 
 void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
 {
+    QStringList actions;
+    bool handled = GetMythMainWindow()->
+        TranslateKeyPress("TV Playback", e, actions, false);
+    if (handled)
+        VERBOSE(VB_IMPORTANT,
+                "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;
+    do {
+        ++iterations;
+
     bool ignoreKeys = actx->IsPlayerChangingBuffers();
 #if DEBUG_ACTIONS
     VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1")
@@ -3512,8 +3528,7 @@
         idleTimerId = StartTimer(db_idle_timeout, __LINE__);
     }
 
-    QStringList actions;
-    bool handled = false;
+    handled = false;
 
     if (ignoreKeys)
     {
@@ -3521,20 +3536,23 @@
                   "TV Playback", e, actions);
 
         if (handled || actions.isEmpty())
-            return;
+            continue;
 
         bool esc   = has_action("ESCAPE", actions);
         bool pause = has_action("PAUSE",  actions);
         bool play  = has_action("PLAY",   actions);
 
         if ((!esc || browsemode) && !pause && !play)
-            return;
+            continue;
     }
 
     OSD *osd = GetOSDLock(actx);
     if (osd && osd->DialogVisible())
     {
-        osd->DialogHandleKeypress(e);
+        if (GetMythMainWindow()->IsExitingToMain())
+            osd->DialogQuit();
+        else
+            osd->DialogHandleKeypress(e);
         handled = true;
     }
 
@@ -3561,7 +3579,7 @@
     ReturnOSDLock(actx, osd);
 
     if (handled)
-        return;
+        continue;
 
     // If text is already queued up, be more lax on what is ok.
     // This allows hex teletext entry and minor channel entry.
@@ -3573,10 +3591,11 @@
         if (ok || txt=="_" || txt=="-" || txt=="#" || txt==".")
         {
             AddKeyToInputQueue(actx, txt.at(0).toLatin1());
-            return;
+            continue;
         }
     }
 
+    bool should_continue;
     // Teletext menu
     actx->LockDeletePlayer(__FILE__, __LINE__);
     if (actx->player && (actx->player->GetCaptionMode() == kDisplayTeletextMenu))
@@ -3587,14 +3606,18 @@
 
         if (!handled && !tt_actions.isEmpty())
         {
+            should_continue = false;
             for (int i = 0; i < tt_actions.size(); i++)
             {
                 if (actx->player->HandleTeletextAction(tt_actions[i]))
                 {
                     actx->UnlockDeletePlayer(__FILE__, __LINE__);
-                    return;
+                    should_continue = true;
+                    break;
                 }
             }
+            if (should_continue)
+                continue;
         }
     }
 
@@ -3607,14 +3630,18 @@
 
         if (!handled && !itv_actions.isEmpty())
         {
+            should_continue = false;
             for (int i = 0; i < itv_actions.size(); i++)
             {
                 if (actx->player->ITVHandleAction(itv_actions[i]))
                 {
                     actx->UnlockDeletePlayer(__FILE__, __LINE__);
-                    return;
+                    should_continue = true;
+                    break;
                 }
             }
+            if (should_continue)
+                continue;
         }
     }
     actx->UnlockDeletePlayer(__FILE__, __LINE__);
@@ -3623,7 +3650,7 @@
               "TV Playback", e, actions);
 
     if (handled || actions.isEmpty())
-        return;
+        continue;
 
     handled = false;
 
@@ -3649,7 +3676,7 @@
 #endif // DEBUG_ACTIONS
 
     if (handled)
-        return;
+        continue;
 
     if (!handled)
     {
@@ -3666,6 +3693,10 @@
             }
         }
     }
+
+    } while (isJumpingToMain &&
+             exitPlayerTimerId == 0 &&
+             iterations <= kMaxIterations);
 }
 
 bool TV::BrowseHandleAction(PlayerContext *ctx, const QStringList &actions)
Index: programs/mythfrontend/playbackbox.cpp
===================================================================
--- programs/mythfrontend/playbackbox.cpp	(revision 26040)
+++ programs/mythfrontend/playbackbox.cpp	(working copy)
@@ -2244,7 +2244,7 @@
 
     m_playingSomething = false;
 
-    if (inPlaylist && !m_playListPlay.empty())
+    if (inPlaylist && !m_playListPlay.empty() && !GetMythMainWindow()->IsExitingToMain())
     {
         QCoreApplication::postEvent(
             this, new MythEvent("PLAY_PLAYLIST"));
