[vlc-commits] aout: coreaudio: decrease sleep duration when circular buffer is full

Thomas Guillem git at videolan.org
Wed Jul 19 18:58:21 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 19 16:06:02 2017 +0200| [abebf6a0025048e005997c623c086ecaf9b6a7cf] | committer: Thomas Guillem

aout: coreaudio: decrease sleep duration when circular buffer is full

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=abebf6a0025048e005997c623c086ecaf9b6a7cf
---

 modules/audio_output/coreaudio_common.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/audio_output/coreaudio_common.c b/modules/audio_output/coreaudio_common.c
index 69dba235ab..f37d93d240 100644
--- a/modules/audio_output/coreaudio_common.c
+++ b/modules/audio_output/coreaudio_common.c
@@ -107,8 +107,7 @@ ca_Flush(audio_output_t *p_aout, bool wait)
             const mtime_t i_frame_us =
                 FramesToUs(p_sys, BytesToFrames(p_sys, i_bytes)) + 10000;
 
-            /* Don't sleep less than 10ms */
-            msleep(__MAX(i_frame_us, 10000));
+            msleep(i_frame_us / 2);
         }
     }
     else
@@ -166,8 +165,7 @@ ca_Play(audio_output_t * p_aout, block_t * p_block)
         /* Wait for the render buffer to play the remaining data */
         const mtime_t i_frame_us =
             FramesToUs(p_sys, BytesToFrames(p_sys, p_block->i_buffer));
-        /* Don't sleep less than 10ms */
-        msleep(__MAX(i_frame_us, 10000));
+        msleep(i_frame_us / 2);
     }
 
     unsigned i_underrun_size = atomic_exchange(&p_sys->i_underrun_size, 0);



More information about the vlc-commits mailing list