]> git.sesse.net Git - vlc/commitdiff
* src/audio_output/output.c: check if start_date is null in
authorCyril Deguet <asmax@videolan.org>
Sat, 21 Aug 2004 12:38:53 +0000 (12:38 +0000)
committerCyril Deguet <asmax@videolan.org>
Sat, 21 Aug 2004 12:38:53 +0000 (12:38 +0000)
   aout_OutputNextBuffer(), then do not try to resample or play silences.
   Now everything works perfectly with screwed ALSA drivers that always
   return zero in snd_pcm_status_get_tstamp() (at last!!!)

src/audio_output/output.c

index 98d788d06483dc2abb990cb48c9bddd6173d7b28..8e166afc7893f4f0b89be745c0a6da55d2e8b84d 100644 (file)
@@ -306,8 +306,11 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
     }
 
     /* Here we suppose that all buffers have the same duration - this is
-     * generally true, and anyway if it's wrong it won't be a disaster. */
-    if ( p_buffer->start_date > start_date
+     * generally true, and anyway if it's wrong it won't be a disaster.
+     * start_date may be null with some screwed ALSA driver; then do not
+     * try to play silences or resample.
+     */
+    if ( start_date && p_buffer->start_date > start_date
                          + (p_buffer->end_date - p_buffer->start_date) )
     /*
      *                   + AOUT_PTS_TOLERANCE )
@@ -326,7 +329,7 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
 
     p_aout->output.b_starving = 0;
 
-    if ( !b_can_sleek &&
+    if ( !b_can_sleek && start_date &&
           ( (p_buffer->start_date - start_date > AOUT_PTS_TOLERANCE)
              || (start_date - p_buffer->start_date > AOUT_PTS_TOLERANCE) ) )
     {