changeset 24821:3b23a0e6fe7b

Don't wait for filling entire audio ringbuffer at each call to grab_audio_frame. Fixes 2 minutes delay before starting playback and audio clicks in sound (at least for my SAA7134 based card while capturing radio through saa7134-alsa module).
author voroshil
date Thu, 25 Oct 2007 15:04:33 +0000
parents 833520054ee5
children b78e0519fae5
files stream/stream_radio.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_radio.c	Thu Oct 25 14:57:17 2007 +0000
+++ b/stream/stream_radio.c	Thu Oct 25 15:04:33 2007 +0000
@@ -793,7 +793,7 @@
        1000ms delay will happen only at first buffer filling. At next call function
        just fills buffer until either buffer full or no data from driver available.
     */
-    for (i=0;i<1000 && priv->audio_cnt<priv->audio_buffer_size; i++){
+    for (i=0;i<1000 && !priv->audio_cnt; i++){
         //read_chunk fills exact priv->blocksize bytes
         if(read_chunk(&priv->audio_in, priv->audio_ringbuffer+priv->audio_tail) < 0){
             //sleppeing only when waiting first block to fill empty buffer