[FFmpeg-devel] [PATCH v3 1/2] ffplay: Seek only when pressing the right mouse button on the video window.

Vittorio Gambaletta (VittGam) ffmpeg-dev at vittgam.net
Tue Jan 19 00:57:38 CET 2016


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 at vittgam.net>

---
 Changelog |    1 +
 ffplay.c  |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index ed18cf1..d458991 100644
--- a/Changelog
+++ b/Changelog
@@ -54,6 +54,7 @@ version <next>:
 - libstagefright support removed
 - spectrumsynth filter
 - ahistogram filter
+- only seek with the right mouse button in ffplay
 
 
 version 2.8:
diff --git a/ffplay.c b/ffplay.c
index d2e3dc6..2fa7165 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3480,9 +3480,11 @@ static void event_loop(VideoState *cur_stream)
             }
             cursor_last_shown = av_gettime_relative();
             if (event.type == SDL_MOUSEBUTTONDOWN) {
+                if (event.button.button != SDL_BUTTON_RIGHT)
+                    break;
                 x = event.button.x;
             } else {
-                if (event.motion.state != SDL_PRESSED)
+                if (!(event.motion.state & SDL_BUTTON_RMASK))
                     break;
                 x = event.motion.x;
             }


More information about the ffmpeg-devel mailing list