changeset 35132:5ba6eb55d311

Avoid sleeping for too long without reacting to user input. Fixes bug #2092.
author reimar
date Mon, 01 Oct 2012 19:47:45 +0000
parents 011bbb6c624b
children 816fffbf8647
files mplayer.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Sun Sep 30 09:48:37 2012 +0000
+++ b/mplayer.c	Mon Oct 01 19:47:45 2012 +0000
@@ -2292,8 +2292,15 @@
     //============================== SLEEP: ===================================
 
     // flag 256 means: libvo driver does its timing (dvb card)
-    if (*time_frame > 0.001 && !(vo_flags & 256))
-        *time_frame = timing_sleep(*time_frame);
+    if (!(vo_flags & 256)) {
+        if (*time_frame > 1.5) {
+            // Avoid sleeping too long without reacting to user input
+            usec_sleep(1000000);
+            *time_frame -= GetRelativeTime();
+            frame_time_remaining = 1;
+	} else if (*time_frame > 0.001)
+            *time_frame = timing_sleep(*time_frame);
+    }
 
     handle_udp_master(mpctx->sh_video->pts);