Advertisement
svenhoefer

Untitled

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