Browse code

ffplay: seek only when pressing the right mouse button on the video window

Seeking by clicking on the video window can be annoying, because
the user might click on it accidentally while eg. trying to get
focus on it, and ffplay seeks instead.

This commit changes that behaviour to seek only when the right
mouse button is used to click and drag on the window.

Signed-off-by: Vittorio Gambaletta <ffmpeg-dev@vittgam.net>
Signed-off-by: Marton Balint <cus@passwd.hu>

Vittorio Gambaletta (VittGam) authored on 2016/01/19 08:57:38
Showing 2 changed files
... ...
@@ -54,6 +54,7 @@ version <next>:
54 54
 - libstagefright support removed
55 55
 - spectrumsynth filter
56 56
 - ahistogram filter
57
+- only seek with the right mouse button in ffplay
57 58
 
58 59
 
59 60
 version 2.8:
... ...
@@ -3480,9 +3480,11 @@ static void event_loop(VideoState *cur_stream)
3480 3480
             }
3481 3481
             cursor_last_shown = av_gettime_relative();
3482 3482
             if (event.type == SDL_MOUSEBUTTONDOWN) {
3483
+                if (event.button.button != SDL_BUTTON_RIGHT)
3484
+                    break;
3483 3485
                 x = event.button.x;
3484 3486
             } else {
3485
-                if (event.motion.state != SDL_PRESSED)
3487
+                if (!(event.motion.state & SDL_BUTTON_RMASK))
3486 3488
                     break;
3487 3489
                 x = event.motion.x;
3488 3490
             }