|
|
@ -2929,21 +2929,20 @@ static void toggle_audio_display(VideoState *is) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) { |
|
|
|
static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) { |
|
|
|
int got_event; |
|
|
|
double remaining_time = 0.0; |
|
|
|
double remaining_time; |
|
|
|
SDL_PumpEvents(); |
|
|
|
do { |
|
|
|
while (!SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)) { |
|
|
|
if (!cursor_hidden && av_gettime() - cursor_last_shown > CURSOR_HIDE_DELAY) { |
|
|
|
if (!cursor_hidden && av_gettime() - cursor_last_shown > CURSOR_HIDE_DELAY) { |
|
|
|
SDL_ShowCursor(0); |
|
|
|
SDL_ShowCursor(0); |
|
|
|
cursor_hidden = 1; |
|
|
|
cursor_hidden = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (remaining_time > 0.0) |
|
|
|
|
|
|
|
av_usleep((int64_t)(remaining_time * 1000000.0)); |
|
|
|
remaining_time = REFRESH_RATE; |
|
|
|
remaining_time = REFRESH_RATE; |
|
|
|
if (is->show_mode != SHOW_MODE_NONE && (!is->paused || is->force_refresh)) |
|
|
|
if (is->show_mode != SHOW_MODE_NONE && (!is->paused || is->force_refresh)) |
|
|
|
video_refresh(is, &remaining_time); |
|
|
|
video_refresh(is, &remaining_time); |
|
|
|
SDL_PumpEvents(); |
|
|
|
SDL_PumpEvents(); |
|
|
|
got_event = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS); |
|
|
|
} |
|
|
|
if (!got_event) |
|
|
|
|
|
|
|
av_usleep((int64_t)(remaining_time * 1000000.0)); |
|
|
|
|
|
|
|
} while (!got_event); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* handle an event sent by the GUI */ |
|
|
|
/* handle an event sent by the GUI */ |
|
|
|