]> git.sesse.net Git - vlc/commitdiff
* src/audio_output/output.c: skip late buffers in b_can_sleek mode (patch courtesy...
authorGildas Bazin <gbazin@videolan.org>
Thu, 20 Jan 2005 15:28:56 +0000 (15:28 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 20 Jan 2005 15:28:56 +0000 (15:28 +0000)
src/audio_output/output.c

index c289d2713fb83388d9a30fb800647ac28e3f2dbc..8ce23ccc7b825165ba8b1d0729c1eef64405c314 100644 (file)
@@ -275,7 +275,12 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
     vlc_mutex_lock( &p_aout->output_fifo_lock );
 
     p_buffer = p_aout->output.fifo.p_first;
-    while ( p_buffer && p_buffer->start_date < mdate() - AOUT_PTS_TOLERANCE )
+
+    /* Drop the audio sample if the audio output is really late.
+     * In the case of b_can_sleek, we don't use a resampler so we need to be
+     * a lot more severe. */
+    while ( p_buffer && p_buffer->start_date <
+            (b_can_sleek ? start_date : mdate()) - AOUT_PTS_TOLERANCE )
     {
         msg_Dbg( p_aout, "audio output is too slow ("I64Fd"), "
                  "trashing "I64Fd"us", mdate() - p_buffer->start_date,