Advertisement
svenhoefer

Untitled

May 13th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.98 KB | None | 0 0
  1. diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp
  2. index bed0d13..bdcfbb9 100644
  3. --- a/src/gui/movieplayer.cpp
  4. +++ b/src/gui/movieplayer.cpp
  5. @@ -1351,6 +1351,10 @@ void CMoviePlayerGui::PlayFileLoop(void)
  6.     bool at_eof = !(playstate >= CMoviePlayerGui::PLAY);;
  7.     keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL;
  8.  
  9. +   //NI - bisectional search
  10. +   int bisection_jump = 300;
  11. +   int bisection_loop = -1;
  12. +
  13.     while (playstate >= CMoviePlayerGui::PLAY)
  14.     {
  15.         if (update_lcd) {
  16. @@ -1366,6 +1370,12 @@ void CMoviePlayerGui::PlayFileLoop(void)
  17.         neutrino_msg_data_t data;
  18.         g_RCInput->getMsg(&msg, &data, 10); // 1 secs..
  19.  
  20. +       //NI - bisectional search
  21. +       if (bisection_loop > -1)
  22. +           bisection_loop++;
  23. +       if (bisection_loop > 5)
  24. +           bisection_loop = -1;
  25. +
  26.         if ((playstate >= CMoviePlayerGui::PLAY) && (timeshift != TSHIFT_MODE_OFF || (playstate != CMoviePlayerGui::PAUSE))) {
  27.             if (playback->GetPosition(position, duration)) {
  28.                 FileTimeOSD->update(position, duration);
  29. @@ -1610,10 +1620,24 @@ void CMoviePlayerGui::PlayFileLoop(void)
  30.             SetPosition(duration/2, true);
  31.         } else if (msg == CRCInput::RC_8) { // goto end
  32.             SetPosition(duration - 60 * 1000, true);
  33. +//NI
  34. +#if 0
  35.         } else if (msg == CRCInput::RC_page_up) {
  36.             SetPosition(10 * 1000);
  37.         } else if (msg == CRCInput::RC_page_down) {
  38.             SetPosition(-10 * 1000);
  39. +#endif
  40. +       //NI - bisectional search
  41. +       } else if (msg == CRCInput::RC_page_up || msg == CRCInput::RC_page_down) {
  42. +           if ((lastmsg == CRCInput::RC_page_up || lastmsg == CRCInput::RC_page_down) && (bisection_loop > -1 && bisection_loop <= 5))
  43. +               bisection_jump = bisection_jump/2;
  44. +           else
  45. +               bisection_jump = 300;
  46. +
  47. +           bisection_loop = 0;
  48. +
  49. +           int direction = (msg == CRCInput::RC_page_up) ? 1 : -1;
  50. +           SetPosition(direction*bisection_jump * 1000);
  51.         } else if (msg == CRCInput::RC_0) { // cancel bookmark jump
  52.             handleMovieBrowser(CRCInput::RC_0, position);
  53.         } else if (msg == (neutrino_msg_t) g_settings.mpkey_goto) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement