[MPlayer-cvslog] r34693 - trunk/mplayer.c

reimar subversion at mplayerhq.hu
Sun Feb 12 14:35:18 CET 2012


Author: reimar
Date: Sun Feb 12 14:35:17 2012
New Revision: 34693

Log:
Try to detect when an audio driver ends up hanging after
repeated seeks.

This should at least give a clear message in the case of
bug 2039.

Modified:
   trunk/mplayer.c

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Sun Feb 12 01:37:23 2012	(r34692)
+++ trunk/mplayer.c	Sun Feb 12 14:35:17 2012	(r34693)
@@ -2119,6 +2119,7 @@ static int fill_audio_out_buffers(void)
     int audio_eof = 0;
     int bytes_to_write;
     int format_change = 0;
+    int timeout = 0;
     sh_audio_t *const sh_audio = mpctx->sh_audio;
 
     current_module = "play_audio";
@@ -2132,6 +2133,10 @@ static int fill_audio_out_buffers(void)
         bytes_to_write = mpctx->audio_out->get_space();
         if (mpctx->sh_video || bytes_to_write >= ao_data.outburst)
             break;
+        if (timeout++ > 10) {
+            mp_msg(MSGT_CPLAYER, MSGL_WARN, "Audio device got stuck!\n");
+            break;
+        }
 
         // handle audio-only case:
         // this is where mplayer sleeps during audio-only playback


More information about the MPlayer-cvslog mailing list