]> git.sesse.net Git - vlc/blobdiff - src/audio_output/output.c
* modules/codec/ffmpeg/: don't re-use the same pts twice.
[vlc] / src / audio_output / output.c
index 246e61e94a8a198cbaad45e2d66f4042cddd5761..5705dd0cad4cce9a1a78308f684f5cbeb5a3ad4f 100644 (file)
@@ -2,7 +2,7 @@
  * output.c : internal management of output streams for the audio output
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: output.c,v 1.38 2003/05/04 22:42:17 gbazin Exp $
+ * $Id: output.c,v 1.41 2003/07/09 21:42:28 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -142,7 +142,7 @@ int aout_OutputNew( aout_instance_t * p_aout,
             text.psz_string = _("Stereo");
         }
         var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val, &text );
-        val.i_int = AOUT_VAR_CHAN_LEFT; text.i_int = _("Left");
+        val.i_int = AOUT_VAR_CHAN_LEFT; text.psz_string = _("Left");
         var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val, &text );
         val.i_int = AOUT_VAR_CHAN_RIGHT; text.psz_string = _("Right");
         var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val, &text );
@@ -271,7 +271,7 @@ 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() )
+    while ( p_buffer && p_buffer->start_date < mdate() - AOUT_PTS_TOLERANCE )
     {
         msg_Dbg( p_aout, "audio output is too slow ("I64Fd"), "
                  "trashing "I64Fd"us", mdate() - p_buffer->start_date,
@@ -305,6 +305,12 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
      * generally true, and anyway if it's wrong it won't be a disaster. */
     if ( p_buffer->start_date > start_date
                          + (p_buffer->end_date - p_buffer->start_date) )
+    /*
+     *                   + AOUT_PTS_TOLERANCE )
+     * There is no reason to want that, it just worsen the scheduling of
+     * an audio sample after an output starvation (ie. on start or on resume)
+     * --Gibalou
+     */
     {
         vlc_mutex_unlock( &p_aout->output_fifo_lock );
         if ( !p_aout->output.b_starving )