Changeset 84:cd538d13337e in roaraudio


Ignore:
Timestamp:
07/12/08 21:55:02 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fixed some bugs with multible streams per client

Location:
roard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r78 r84  
    135135   if ( fh > max_fh ) 
    136136    max_fh = fh; 
    137   } else { 
    138  
    139    for (j = 0; j < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; j++) { 
    140     if ( (fh = streams_get_fh(g_clients[i]->streams[j])) != -1 ) { 
    141      FD_SET(fh, &r); 
    142  
    143      if ( fh > max_fh ) 
    144       max_fh = fh; 
    145     } 
    146    } 
     137  } 
     138 
     139  for (j = 0; j < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; j++) { 
     140   if ( (fh = streams_get_fh(g_clients[i]->streams[j])) != -1 ) { 
     141    FD_SET(fh, &r); 
     142 
     143    if ( fh > max_fh ) 
     144     max_fh = fh; 
     145   } 
     146   //printf("D: client=%i, stream=%i, fh=%i\n", i, j, fh); 
    147147  } 
    148148 
     
    166166   } 
    167167 
    168    if ( FD_ISSET(fh, &e) ) 
     168   if ( FD_ISSET(fh, &e) ) { 
    169169    clients_delete(i); 
    170   } else { 
    171    for (j = 0; j < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; j++) { 
    172     if ( (fh = streams_get_fh(g_clients[i]->streams[j])) != -1 ) { 
    173      if ( FD_ISSET(fh, &r) ) { 
    174       streams_check(g_clients[i]->streams[j]); 
    175      } 
     170    continue; 
     171   } 
     172  } 
     173 
     174  if ( g_clients[i] == NULL ) 
     175   continue; 
     176 
     177  for (j = 0; j < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; j++) { 
     178   //printf("D: client=%i, stream=%i, g_clients[i=%i] = %p\n", i, j, i, g_clients[i]); 
     179   if ( (fh = streams_get_fh(g_clients[i]->streams[j])) != -1 ) { 
     180    if ( FD_ISSET(fh, &r) ) { 
     181     streams_check(g_clients[i]->streams[j]); 
    176182    } 
    177183   } 
  • roard/req.c

    r80 r84  
    107107 len = mes->datalen - 4; 
    108108 
    109  strncmp(host, &(mes->data[4]), len); 
     109 strncpy(host, &(mes->data[4]), len); 
    110110 host[len] = 0; 
    111111 
  • roard/streams.c

    r66 r84  
    122122 
    123123int streams_get_fh     (int id) { 
     124 if ( id < 0 ) 
     125  return -1; 
     126 
    124127 if ( g_streams[id] == NULL ) 
    125128  return -1; 
     
    360363 
    361364int streams_get_mixbuffers (void *** bufferlist, struct roar_audio_info * info, unsigned int pos) { 
    362  static void * bufs[ROAR_STREAMS_MAX]; 
     365 static void * bufs[ROAR_STREAMS_MAX+1]; 
    363366 int i; 
    364367 int have = 0; 
Note: See TracChangeset for help on using the changeset viewer.