[vlc-devel] [PATCH] kai: enlarge audio buffer to the enough size to play for 5 seconds

KO Myung-Hun komh78 at gmail.com
Sat Mar 2 18:16:02 CET 2013


If a block size is larger than a buffer size, WriterBuffer() is locked
indefinitely.
---
 modules/audio_output/kai.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/kai.c b/modules/audio_output/kai.c
index 20b995b..db36a22 100644
--- a/modules/audio_output/kai.c
+++ b/modules/audio_output/kai.c
@@ -37,7 +37,7 @@
 
 #define FRAME_SIZE 2048
 
-#define AUDIO_BUFFER_SIZE ( 64 * 1024 )
+#define AUDIO_BUFFER_SIZE_IN_SECONDS 5
 
 struct audio_buffer_t
 {
@@ -225,7 +225,8 @@ static int Start ( audio_output_t *p_aout, audio_sample_format_t *fmt )
 
     aout_SoftVolumeStart( p_aout );
 
-    CreateBuffer( p_aout, AUDIO_BUFFER_SIZE );
+    CreateBuffer( p_aout, AUDIO_BUFFER_SIZE_IN_SECONDS *
+                          format.i_rate * format.i_bytes_per_frame );
 
     if ( var_Type( p_aout, "audio-device" ) == 0 )
     {
-- 
1.7.3.2




More information about the vlc-devel mailing list