]> git.sesse.net Git - vlc/commitdiff
aout_OutputNextBuffer: do not dequeue when paused
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 4 Aug 2011 18:25:53 +0000 (21:25 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 4 Aug 2011 19:12:14 +0000 (22:12 +0300)
This greatly reduces the latency when pausing a legacy audio output.
Unfortunately, the audio output will keep polling for buffers though.

src/audio_output/output.c

index 72a9a7f2c5e89db7467b245b1d8b226896202710..7fdb531f6afc5463f32db74945e8fca573e6d696 100644 (file)
@@ -613,10 +613,12 @@ aout_buffer_t * aout_OutputNextBuffer( audio_output_t * p_aout,
 {
     aout_packet_t *p = aout_packet (p_aout);
     aout_fifo_t *p_fifo = &p->fifo;
-    aout_buffer_t * p_buffer;
+    aout_buffer_t *p_buffer = NULL;
     mtime_t now = mdate();
 
     vlc_mutex_lock( &p->lock );
+    if( p->pause_date != VLC_TS_INVALID )
+        goto out;
 
     /* 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