# HG changeset patch # User reimar # Date 1329053717 0 # Node ID b85d4539ad077d6d5ff3e0eed67a87bdebed76b2 # Parent 1efa9c367aab4438ed3b174916d8d0f0ee2fae36 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. diff -r 1efa9c367aab -r b85d4539ad07 mplayer.c --- a/mplayer.c Sun Feb 12 00:37:23 2012 +0000 +++ b/mplayer.c Sun Feb 12 13:35:17 2012 +0000 @@ -2119,6 +2119,7 @@ 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 @@ 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