Ticket #7939: tv_jumppoints_v5.patch
File tv_jumppoints_v5.patch, 4.8 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/tv_play.cpp
3500 3500 3501 3501 void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) 3502 3502 { 3503 QStringList actions; 3504 bool handled = GetMythMainWindow()-> 3505 TranslateKeyPress("TV Playback", e, actions, false); 3506 if (handled) 3507 VERBOSE(VB_IMPORTANT, 3508 "ProcessKeypress(): " 3509 "TranslateKeyPress() unexpectedly returned true"); 3510 bool isJumpingToMain = has_action("ESCAPE", actions) && 3511 GetMythMainWindow()->IsExitingToMain(); 3512 unsigned iterations = 0; 3513 // Set a limit on the number of iterations in case pressing escape 3514 // repeatedly somehow gets into a loop. 3515 const unsigned kMaxIterations = 10; 3516 do { 3517 ++iterations; 3518 3503 3519 bool ignoreKeys = actx->IsPlayerChangingBuffers(); 3504 3520 #if DEBUG_ACTIONS 3505 3521 VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1") … … 3512 3528 idleTimerId = StartTimer(db_idle_timeout, __LINE__); 3513 3529 } 3514 3530 3515 QStringList actions; 3516 bool handled = false; 3531 handled = false; 3517 3532 3518 3533 if (ignoreKeys) 3519 3534 { … … 3521 3536 "TV Playback", e, actions); 3522 3537 3523 3538 if (handled || actions.isEmpty()) 3524 return;3539 continue; 3525 3540 3526 3541 bool esc = has_action("ESCAPE", actions); 3527 3542 bool pause = has_action("PAUSE", actions); 3528 3543 bool play = has_action("PLAY", actions); 3529 3544 3530 3545 if ((!esc || browsemode) && !pause && !play) 3531 return;3546 continue; 3532 3547 } 3533 3548 3534 3549 OSD *osd = GetOSDLock(actx); 3535 3550 if (osd && osd->DialogVisible()) 3536 3551 { 3537 osd->DialogHandleKeypress(e); 3552 if (GetMythMainWindow()->IsExitingToMain()) 3553 osd->DialogQuit(); 3554 else 3555 osd->DialogHandleKeypress(e); 3538 3556 handled = true; 3539 3557 } 3540 3558 … … 3561 3579 ReturnOSDLock(actx, osd); 3562 3580 3563 3581 if (handled) 3564 return;3582 continue; 3565 3583 3566 3584 // If text is already queued up, be more lax on what is ok. 3567 3585 // This allows hex teletext entry and minor channel entry. … … 3573 3591 if (ok || txt=="_" || txt=="-" || txt=="#" || txt==".") 3574 3592 { 3575 3593 AddKeyToInputQueue(actx, txt.at(0).toLatin1()); 3576 return;3594 continue; 3577 3595 } 3578 3596 } 3579 3597 3598 bool should_continue; 3580 3599 // Teletext menu 3581 3600 actx->LockDeletePlayer(__FILE__, __LINE__); 3582 3601 if (actx->player && (actx->player->GetCaptionMode() == kDisplayTeletextMenu)) … … 3587 3606 3588 3607 if (!handled && !tt_actions.isEmpty()) 3589 3608 { 3609 should_continue = false; 3590 3610 for (int i = 0; i < tt_actions.size(); i++) 3591 3611 { 3592 3612 if (actx->player->HandleTeletextAction(tt_actions[i])) 3593 3613 { 3594 3614 actx->UnlockDeletePlayer(__FILE__, __LINE__); 3595 return; 3615 should_continue = true; 3616 break; 3596 3617 } 3597 3618 } 3619 if (should_continue) 3620 continue; 3598 3621 } 3599 3622 } 3600 3623 … … 3607 3630 3608 3631 if (!handled && !itv_actions.isEmpty()) 3609 3632 { 3633 should_continue = false; 3610 3634 for (int i = 0; i < itv_actions.size(); i++) 3611 3635 { 3612 3636 if (actx->player->ITVHandleAction(itv_actions[i])) 3613 3637 { 3614 3638 actx->UnlockDeletePlayer(__FILE__, __LINE__); 3615 return; 3639 should_continue = true; 3640 break; 3616 3641 } 3617 3642 } 3643 if (should_continue) 3644 continue; 3618 3645 } 3619 3646 } 3620 3647 actx->UnlockDeletePlayer(__FILE__, __LINE__); … … 3623 3650 "TV Playback", e, actions); 3624 3651 3625 3652 if (handled || actions.isEmpty()) 3626 return;3653 continue; 3627 3654 3628 3655 handled = false; 3629 3656 … … 3649 3676 #endif // DEBUG_ACTIONS 3650 3677 3651 3678 if (handled) 3652 return;3679 continue; 3653 3680 3654 3681 if (!handled) 3655 3682 { … … 3666 3693 } 3667 3694 } 3668 3695 } 3696 3697 } while (isJumpingToMain && 3698 exitPlayerTimerId == 0 && 3699 iterations <= kMaxIterations); 3669 3700 } 3670 3701 3671 3702 bool TV::BrowseHandleAction(PlayerContext *ctx, const QStringList &actions) -
programs/mythfrontend/playbackbox.cpp
2244 2244 2245 2245 m_playingSomething = false; 2246 2246 2247 if (inPlaylist && !m_playListPlay.empty() )2247 if (inPlaylist && !m_playListPlay.empty() && !GetMythMainWindow()->IsExitingToMain()) 2248 2248 { 2249 2249 QCoreApplication::postEvent( 2250 2250 this, new MythEvent("PLAY_PLAYLIST"));