summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavdevice/sdl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavdevice/sdl.c b/libavdevice/sdl.c
index c3ade4a38d..72d327e8e8 100644
--- a/libavdevice/sdl.c
+++ b/libavdevice/sdl.c
@@ -180,10 +180,14 @@ init_end:
SDL_Event event;
SDL_PumpEvents();
ret = SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_ALLEVENTS);
- if (ret < 0)
+ if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Error when getting SDL event: %s\n", SDL_GetError());
- if (ret <= 0)
continue;
+ }
+ if (ret == 0) {
+ SDL_Delay(10);
+ continue;
+ }
switch (event.type) {
case SDL_KEYDOWN: