[vlc-commits] Cache mdate()
    Rémi Denis-Courmont 
    git at videolan.org
       
    Thu Mar 31 20:37:00 CEST 2011
    
    
  
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Mar 31 21:07:21 2011 +0300| [7bd81c85586163d5205049ed5f37d8039b8270f6] | committer: Rémi Denis-Courmont
Cache mdate()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7bd81c85586163d5205049ed5f37d8039b8270f6
---
 src/audio_output/output.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index ee37b38..0642f19 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -272,6 +272,7 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
                                        bool b_can_sleek )
 {
     aout_buffer_t * p_buffer;
+    mtime_t now = mdate();
 
     aout_lock_output_fifo( p_aout );
 
@@ -281,10 +282,10 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
      * 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->i_pts <
-            (b_can_sleek ? start_date : mdate()) - AOUT_PTS_TOLERANCE )
+            (b_can_sleek ? start_date : now) - AOUT_PTS_TOLERANCE )
     {
         msg_Dbg( p_aout, "audio output is too slow (%"PRId64"), "
-                 "trashing %"PRId64"us", mdate() - p_buffer->i_pts,
+                 "trashing %"PRId64"us", now - p_buffer->i_pts,
                  p_buffer->i_length );
         p_buffer = p_buffer->p_next;
         aout_BufferFree( p_aout->output.fifo.p_first );
    
    
More information about the vlc-commits
mailing list