mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
ffplay: toggle full screen when double-clicking the video window with the left mouse button
Now that the seek only happens with the right mouse button, it makes sense to toggle full screen when double-clicking with the left mouse button, like other video players do. Signed-off-by: Vittorio Gambaletta <ffmpeg-dev@vittgam.net> Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
cde4b99f47
commit
acd37069ae
2 changed files with 11 additions and 0 deletions
|
|
@ -55,6 +55,7 @@ version <next>:
|
|||
- spectrumsynth filter
|
||||
- ahistogram filter
|
||||
- only seek with the right mouse button in ffplay
|
||||
- toggle full screen when double-clicking with the left mouse button in ffplay
|
||||
|
||||
|
||||
version 2.8:
|
||||
|
|
|
|||
10
ffplay.c
10
ffplay.c
|
|
@ -3473,6 +3473,16 @@ static void event_loop(VideoState *cur_stream)
|
|||
do_exit(cur_stream);
|
||||
break;
|
||||
}
|
||||
if (event.button.button == SDL_BUTTON_LEFT) {
|
||||
static int64_t last_mouse_left_click = 0;
|
||||
if (av_gettime_relative() - last_mouse_left_click <= 500000) {
|
||||
toggle_full_screen(cur_stream);
|
||||
cur_stream->force_refresh = 1;
|
||||
last_mouse_left_click = 0;
|
||||
} else {
|
||||
last_mouse_left_click = av_gettime_relative();
|
||||
}
|
||||
}
|
||||
case SDL_MOUSEMOTION:
|
||||
if (cursor_hidden) {
|
||||
SDL_ShowCursor(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue