Changeset 547:797f5692456f in roaraudio


Ignore:
Timestamp:
08/18/08 18:03:26 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

updated --terminate to wait for all clients AND streams, this is usefull for source streams sill running

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/loop.c

    r259 r547  
    55int main_loop (int driver, DRIVER_USERDATA_T driver_inst, struct roar_audio_info * sa) { 
    66 void ** streams_input = NULL; 
     7 int     term = 0; 
     8 int     streams; 
    79#ifdef MONITOR_LATENCY 
    810 struct timeval         try, ans; 
     
    3133 
    3234  ROAR_DBG("main_loop(*): check for new data..."); 
    33   if ( clients_check_all() == 0 && g_terminate && g_listen_socket == -1 ) 
    34    alive = 0; 
     35  if ( clients_check_all() == 0 && g_terminate && g_listen_socket == -1 ) { 
     36   term  = 1; 
     37  } 
    3538 
    3639  ROAR_DBG("main_loop(*): mixing clients..."); 
    3740  if ( g_standby ) { 
    3841   // while in standby we still neet to get the buffers to free input buffer space. 
    39    streams_get_mixbuffers(&streams_input, sa, g_pos); 
     42   streams = streams_get_mixbuffers(&streams_input, sa, g_pos); 
    4043  } else { 
    41    if ( streams_get_mixbuffers(&streams_input, sa, g_pos) == 0 ) { 
     44   if ( ( streams = streams_get_mixbuffers(&streams_input, sa, g_pos)) != -1 ) { 
    4245    mix_clients(g_output_buffer, sa->bits, streams_input, ROAR_OUTPUT_BUFFER_SAMPLES * sa->channels); 
    4346   } 
    4447  } 
     48 
     49  if ( term && streams < 1 ) 
     50   alive = 0; 
    4551 
    4652/* 
  • roard/streams.c

    r538 r547  
    465465 
    466466 *bufferlist = bufs; 
    467  return 0; 
     467 return have; 
    468468} 
    469469 
Note: See TracChangeset for help on using the changeset viewer.