]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Ensure that SDL_AddTimer() is never called with a delay of 0 because
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 24 Aug 2008 00:32:10 +0000 (00:32 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 24 Aug 2008 00:32:10 +0000 (00:32 +0000)
this leads to a runaway creation of timers. We never pass 0 currently
but its safer to check for it explicitly as changes to the code can
easily lead to 0 being used.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14934 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffplay.c

index 7ea077d3bd8835bcbe1e8109f379dbd319d697e0..1119b4fe00c831af9352885a8b278a4f3f7037ae 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -916,6 +916,7 @@ static Uint32 sdl_refresh_timer_cb(Uint32 interval, void *opaque)
 /* schedule a video refresh in 'delay' ms */
 static void schedule_refresh(VideoState *is, int delay)
 {
+    if(!delay) delay=1; //SDL seems to be buggy when the delay is 0
     SDL_AddTimer(delay, sdl_refresh_timer_cb, is);
 }