Changeset 66:a75c2005faeb in roaraudio


Ignore:
Timestamp:
07/12/08 13:38:56 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

finaly got sources working!

Location:
roard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r0 r66  
    111111 struct timeval tv; 
    112112 fd_set r, e; 
    113  int i; 
     113 int i, j; 
    114114 int ret; 
    115115 int fh; 
     
    126126   continue; 
    127127 
    128   if ( (fh = g_clients[i]->fh) == -1 ) 
    129    continue; 
    130  
    131   FD_SET(fh, &r); 
    132   FD_SET(fh, &e); 
    133  
    134   if ( fh > max_fh ) 
    135    max_fh = fh; 
     128  if ( (fh = g_clients[i]->fh) != -1 ) { 
     129   FD_SET(fh, &r); 
     130   FD_SET(fh, &e); 
     131 
     132   if ( fh > max_fh ) 
     133    max_fh = fh; 
     134  } else { 
     135 
     136   for (j = 0; j < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; j++) { 
     137    if ( (fh = streams_get_fh(g_clients[i]->streams[j])) != -1 ) { 
     138     FD_SET(fh, &r); 
     139 
     140     if ( fh > max_fh ) 
     141      max_fh = fh; 
     142    } 
     143   } 
     144  } 
     145 
    136146 } 
    137147 
     
    144154   continue; 
    145155 
    146   if ( (fh = g_clients[i]->fh) == -1 ) 
    147    continue; 
    148  
    149   if ( FD_ISSET(fh, &r) ) { 
    150    if ( g_clients[i]->execed == -1 ) { 
    151     clients_check(i); 
    152    } else { 
    153     streams_check(g_clients[i]->execed); 
    154    } 
    155   } 
    156  
    157   if ( FD_ISSET(fh, &e) ) 
    158    clients_delete(i); 
     156  if ( (fh = g_clients[i]->fh) != -1 ) { 
     157 
     158   if ( FD_ISSET(fh, &r) ) { 
     159    if ( g_clients[i]->execed == -1 ) { 
     160     clients_check(i); 
     161    } else { 
     162     streams_check(g_clients[i]->execed); 
     163    } 
     164   } 
     165 
     166   if ( FD_ISSET(fh, &e) ) 
     167    clients_delete(i); 
     168  } else { 
     169   for (j = 0; j < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; j++) { 
     170    if ( (fh = streams_get_fh(g_clients[i]->streams[j])) != -1 ) { 
     171     if ( FD_ISSET(fh, &r) ) { 
     172      streams_check(g_clients[i]->streams[j]); 
     173     } 
     174    } 
     175   } 
     176  } 
    159177 } 
    160178 
  • roard/include/streams.h

    r21 r66  
    3434 
    3535int streams_set_fh     (int id, int fh); 
     36int streams_get_fh     (int id); 
    3637int streams_get        (int id, struct roar_stream_server ** stream); 
    3738 
  • roard/streams.c

    r53 r66  
    121121} 
    122122 
     123int streams_get_fh     (int id) { 
     124 if ( g_streams[id] == NULL ) 
     125  return -1; 
     126 
     127 return ((struct roar_stream *)g_streams[id])->fh; 
     128} 
    123129 
    124130int streams_get    (int id, struct roar_stream_server ** stream) { 
Note: See TracChangeset for help on using the changeset viewer.