[FFmpeg-devel] [PATCH] ffplay: Add ignore_keydown and ignore_mousedown options.

Vittorio Gambaletta (VittGam) ffmpeg-dev at vittgam.net
Fri Jan 15 00:14:12 CET 2016


On 15/01/2016 00:09:37 CET, Ganesh Ajjanagadde wrote:
> On Thu, Jan 14, 2016 at 6:05 PM, Marton Balint <cus at passwd.hu> wrote:
>> [..]
>> I think it would make sense to change ffplay so that only the right mouse
>> button would seek. This way we can avoid the issue. Anybody against this?
>
> Kind of, it is slightly easier to tap the trackpad on my laptop than
> to right click ;). But this may also be viewed as a negative, it is
> quite easy to accidentally do it, and I have done that myself some
> times.
> In summary, can't think of a better idea myself, and I view it as a
> cleaner solution than the proposed patch.

So, something like this:

diff --git a/ffplay.c b/ffplay.c
index d2e3dc6..0ec98c6 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_PRESSED || event.motion.button != SDL_BUTTON_RIGHT)
                      break;
                  x = event.motion.x;
              }


More information about the ffmpeg-devel mailing list