diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index bbd5d51..22da98c 100644
a
|
b
|
static bool has_action(QString action, const QStringList &actions) |
3412 | 3412 | |
3413 | 3413 | bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) |
3414 | 3414 | { |
| 3415 | QStringList actions; |
| 3416 | bool handled = GetMythMainWindow()-> |
| 3417 | TranslateKeyPress("TV Playback", e, actions, false); |
| 3418 | if (handled) |
| 3419 | VERBOSE(VB_IMPORTANT, |
| 3420 | "ProcessKeypress(): " |
| 3421 | "TranslateKeyPress() unexpectedly returned true"); |
| 3422 | bool isJumpingToMain = has_action("ESCAPE", actions) && |
| 3423 | GetMythMainWindow()->IsExitingToMain(); |
| 3424 | unsigned iterations = 0; |
| 3425 | // Set a limit on the number of iterations in case pressing escape |
| 3426 | // repeatedly somehow gets into a loop. |
| 3427 | const unsigned kMaxIterations = 10; |
| 3428 | bool result; |
| 3429 | do { |
| 3430 | result = ProcessKeypressInternal(actx, e, isJumpingToMain); |
| 3431 | ++iterations; |
| 3432 | } while (isJumpingToMain && |
| 3433 | exitPlayerTimerId == 0 && |
| 3434 | iterations <= kMaxIterations); |
| 3435 | return result; |
| 3436 | } |
| 3437 | |
| 3438 | bool TV::ProcessKeypressInternal(PlayerContext *actx, QKeyEvent *e, |
| 3439 | bool isJumpingToMain) |
| 3440 | { |
3415 | 3441 | bool ignoreKeys = actx->IsPlayerChangingBuffers(); |
3416 | 3442 | #if DEBUG_ACTIONS |
3417 | 3443 | VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1") |
… |
… |
bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) |
3447 | 3473 | OSD *osd = GetOSDLock(actx); |
3448 | 3474 | if (osd && osd->DialogVisible()) |
3449 | 3475 | { |
3450 | | osd->DialogHandleKeypress(e); |
| 3476 | if (isJumpingToMain) |
| 3477 | osd->DialogQuit(); |
| 3478 | else |
| 3479 | osd->DialogHandleKeypress(e); |
3451 | 3480 | handled = true; |
3452 | 3481 | } |
3453 | 3482 | ReturnOSDLock(actx, osd); |
… |
… |
bool TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) |
3466 | 3495 | } |
3467 | 3496 | if (has_action("ESCAPE", actions)) |
3468 | 3497 | { |
| 3498 | if (isJumpingToMain) |
| 3499 | actx->player->DisableEdit(false); |
| 3500 | else |
3469 | 3501 | if (!actx->player->IsCutListSaved(actx)) |
3470 | 3502 | ShowOSDCutpoint(actx, "EXIT_EDIT_MODE"); |
3471 | 3503 | else |
diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
index 247fb03..3a4db3e 100644
a
|
b
|
class MPUBLIC TV : public QObject |
188 | 188 | |
189 | 189 | // User input processing commands |
190 | 190 | bool ProcessKeypress(PlayerContext*, QKeyEvent *e); |
| 191 | bool ProcessKeypressInternal(PlayerContext*, QKeyEvent *e, |
| 192 | bool isJumpingToMain); |
191 | 193 | void ProcessNetworkControlCommand(PlayerContext *, const QString &command); |
192 | 194 | void customEvent(QEvent *e); |
193 | 195 | bool event(QEvent *e); |
diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
index 7c6b253..baf8f61 100644
a
|
b
|
bool PlaybackBox::Play( |
2346 | 2346 | |
2347 | 2347 | m_playingSomething = false; |
2348 | 2348 | |
2349 | | if (inPlaylist && !m_playListPlay.empty()) |
| 2349 | if (inPlaylist && !m_playListPlay.empty() && |
| 2350 | !GetMythMainWindow()->IsExitingToMain()) |
2350 | 2351 | { |
2351 | 2352 | QCoreApplication::postEvent( |
2352 | 2353 | this, new MythEvent("PLAY_PLAYLIST")); |