Changeset 125:8c29ccfbfa5d in roaraudio


Ignore:
Timestamp:
07/13/08 17:26:52 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

try to work around underrun errors of new streams

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/include/streams.h

    r87 r125  
    2424 struct roar_mixer_settings mixer; 
    2525 struct roar_meta meta[ROAR_META_MAX_PER_STREAM]; 
     26 int is_new; 
    2627} * g_streams[ROAR_STREAMS_MAX]; 
    2728 
  • roard/streams.c

    r90 r125  
    5050   ((struct roar_stream_server*)n)->need_extra  = 0; 
    5151   ((struct roar_stream_server*)n)->output      = NULL; 
     52   ((struct roar_stream_server*)n)->is_new      = 1; 
    5253   ((struct roar_stream_server*)n)->mixer.scale = 65535; 
    5354   for (j = 0; j < ROAR_MAX_CHANNELS; j++) 
     
    360361 if ( todo > 0 ) { // zeroize the rest of teh buffer 
    361362  memset(rest, 0, todo); 
    362   ROAR_ERR("streams_fill_mixbuffer(*): Underrun in stream: %i bytes missing, filling with zeros", todo); 
     363 
     364  if ( todo != ROAR_OUTPUT_CALC_OUTBUFSIZE(info) ) { 
     365   if ( !g_streams[id]->is_new ) 
     366    ROAR_ERR("streams_fill_mixbuffer(*): Underrun in stream: %i bytes missing, filling with zeros", todo); 
     367 
     368   g_streams[id]->is_new = 0; 
     369  } 
     370 } else { 
     371  g_streams[id]->is_new = 0; 
    363372 } 
    364373 
Note: See TracChangeset for help on using the changeset viewer.