Ticket #7939: tv_jumppoints_v4.patch
File tv_jumppoints_v4.patch, 4.3 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/tv_play.cpp
3469 3469 3470 3470 void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) 3471 3471 { 3472 QStringList actions; 3473 bool handled = GetMythMainWindow()-> 3474 TranslateKeyPress("TV Playback", e, actions, false); 3475 if (handled) 3476 VERBOSE(VB_IMPORTANT, 3477 "ProcessKeypress(): " 3478 "TranslateKeyPress() unexpectedly returned true"); 3479 bool isJumpingToMain = has_action("ESCAPE", actions) && 3480 GetMythMainWindow()->IsExitingToMain(); 3481 unsigned iterations = 0; 3482 // Set a limit on the number of iterations in case pressing escape 3483 // repeatedly somehow gets into a loop. 3484 const unsigned kMaxIterations = 10; 3485 do { 3486 ++iterations; 3487 3472 3488 bool ignoreKeys = actx->IsPlayerChangingBuffers(); 3473 3489 #if DEBUG_ACTIONS 3474 3490 VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1") … … 3481 3497 idleTimerId = StartTimer(db_idle_timeout, __LINE__); 3482 3498 } 3483 3499 3484 QStringList actions; 3485 bool handled = false; 3500 handled = false; 3486 3501 3487 3502 if (ignoreKeys) 3488 3503 { … … 3490 3505 "TV Playback", e, actions); 3491 3506 3492 3507 if (handled || actions.isEmpty()) 3493 return;3508 continue; 3494 3509 3495 3510 bool esc = has_action("ESCAPE", actions); 3496 3511 bool pause = has_action("PAUSE", actions); 3497 3512 bool play = has_action("PLAY", actions); 3498 3513 3499 3514 if ((!esc || browsemode) && !pause && !play) 3500 return;3515 continue; 3501 3516 } 3502 3517 3503 3518 OSD *osd = GetOSDLock(actx); 3504 3519 if (osd && osd->DialogVisible()) 3505 3520 { 3506 osd->DialogHandleKeypress(e); 3521 if (GetMythMainWindow()->IsExitingToMain()) 3522 osd->DialogQuit(); 3523 else 3524 osd->DialogHandleKeypress(e); 3507 3525 handled = true; 3508 3526 } 3509 3527 … … 3530 3548 ReturnOSDLock(actx, osd); 3531 3549 3532 3550 if (handled) 3533 return;3551 continue; 3534 3552 3535 3553 // If text is already queued up, be more lax on what is ok. 3536 3554 // This allows hex teletext entry and minor channel entry. … … 3542 3560 if (ok || txt=="_" || txt=="-" || txt=="#" || txt==".") 3543 3561 { 3544 3562 AddKeyToInputQueue(actx, txt.at(0).toLatin1()); 3545 return;3563 continue; 3546 3564 } 3547 3565 } 3548 3566 3567 bool should_continue; 3549 3568 // Teletext menu 3550 3569 actx->LockDeletePlayer(__FILE__, __LINE__); 3551 3570 if (actx->player && (actx->player->GetCaptionMode() == kDisplayTeletextMenu)) … … 3556 3575 3557 3576 if (!handled && !tt_actions.isEmpty()) 3558 3577 { 3578 should_continue = false; 3559 3579 for (int i = 0; i < tt_actions.size(); i++) 3560 3580 { 3561 3581 if (actx->player->HandleTeletextAction(tt_actions[i])) 3562 3582 { 3563 3583 actx->UnlockDeletePlayer(__FILE__, __LINE__); 3564 return; 3584 should_continue = true; 3585 break; 3565 3586 } 3566 3587 } 3588 if (should_continue) 3589 continue; 3567 3590 } 3568 3591 } 3569 3592 … … 3576 3599 3577 3600 if (!handled && !itv_actions.isEmpty()) 3578 3601 { 3602 should_continue = false; 3579 3603 for (int i = 0; i < itv_actions.size(); i++) 3580 3604 { 3581 3605 if (actx->player->ITVHandleAction(itv_actions[i])) 3582 3606 { 3583 3607 actx->UnlockDeletePlayer(__FILE__, __LINE__); 3584 return; 3608 should_continue = true; 3609 break; 3585 3610 } 3586 3611 } 3612 if (should_continue) 3613 continue; 3587 3614 } 3588 3615 } 3589 3616 actx->UnlockDeletePlayer(__FILE__, __LINE__); … … 3592 3619 "TV Playback", e, actions); 3593 3620 3594 3621 if (handled || actions.isEmpty()) 3595 return;3622 continue; 3596 3623 3597 3624 handled = false; 3598 3625 … … 3618 3645 #endif // DEBUG_ACTIONS 3619 3646 3620 3647 if (handled) 3621 return;3648 continue; 3622 3649 3623 3650 if (!handled) 3624 3651 { … … 3635 3662 } 3636 3663 } 3637 3664 } 3665 3666 } while (isJumpingToMain && 3667 exitPlayerTimerId == 0 && 3668 iterations <= kMaxIterations); 3638 3669 } 3639 3670 3640 3671 bool TV::BrowseHandleAction(PlayerContext *ctx, const QStringList &actions)