---
ffplay.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/ffplay.c b/ffplay.c
index d2e3dc6..0837d58 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -336,6 +336,8 @@ static int decoder_reorder_pts = -1;
static int autoexit;
static int exit_on_keydown;
static int exit_on_mousedown;
+static int ignore_keydown;
+static int ignore_mousedown;
static int loop = 1;
static int framedrop = -1;
static int infinite_buffer = -1;
@@ -3357,6 +3359,9 @@ static void event_loop(VideoState *cur_stream)
do_exit(cur_stream);
break;
}
+ if (ignore_keydown) {
+ break;
+ }
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
case SDLK_q:
@@ -3479,6 +3484,9 @@ static void event_loop(VideoState *cur_stream)
cursor_hidden = 0;
}
cursor_last_shown = av_gettime_relative();
+ if (ignore_mousedown) {
+ break;
+ }
if (event.type == SDL_MOUSEBUTTONDOWN) {
x = event.button.x;
} else {
@@ -3669,6 +3677,8 @@ static const OptionDef options[] = {
{ "autoexit", OPT_BOOL | OPT_EXPERT, { &autoexit }, "exit at the end", ""
},
{ "exitonkeydown", OPT_BOOL | OPT_EXPERT, { &exit_on_keydown }, "exit on key down",
"" },
{ "exitonmousedown", OPT_BOOL | OPT_EXPERT, { &exit_on_mousedown }, "exit on mouse
down", "" },
+ { "ignorekeydown", OPT_BOOL | OPT_EXPERT, { &ignore_keydown }, "don't act on key
presses", "" },
+ { "ignoremousedown", OPT_BOOL | OPT_EXPERT, { &ignore_mousedown }, "don't seek on mouse
down", "" },
{ "loop", OPT_INT | HAS_ARG | OPT_EXPERT, { &loop }, "set number of times the playback
shall be looped", "loop count" },
{ "framedrop", OPT_BOOL | OPT_EXPERT, { &framedrop }, "drop frames when cpu is too
slow", "" },
{ "infbuf", OPT_BOOL | OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer
size (useful with realtime streams)", "" },