Changeset 5061:df215e585134 in roaraudio for libroar/simple.c
- Timestamp:
- 06/17/11 22:12:21 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/simple.c
r5024 r5061 164 164 #endif 165 165 #ifdef ROAR_HAVE_SELECT 166 int confh; 166 167 fd_set fds; 167 168 struct timeval timeout = {10, 0}; … … 276 277 FD_SET(listen, &fds); 277 278 278 if ( select(listen + 1, &fds, &fds, &fds, &timeout) < 1 ) { 279 confh = roar_get_connection_fh(con); 280 281 if ( confh != -1 ) { 282 FD_SET(confh, &fds); 283 } 284 285 if ( select((confh > listen ? confh : listen) + 1, &fds, &fds, &fds, &timeout) < 1 ) { 279 286 close(listen); 280 287 … … 289 296 } 290 297 291 if ( (fh = accept(listen, NULL, NULL)) != -1 ) { 292 /* errr, do we need we any error handling here? */ 298 if ( FD_ISSET(listen, &fds) ) { 299 if ( (fh = accept(listen, NULL, NULL)) != -1 ) { 300 /* errr, do we need we any error handling here? */ 301 } 302 } else { 303 // we don't need to check the content as we know it failed... 304 if ( roar_recv_message(con, &mes, NULL) == -1 ) 305 return -1; 306 307 if ( roar_kick(con, ROAR_OT_STREAM, s->id) == -1 ) 308 return -1; 309 310 return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir); 293 311 } 294 312 if ( roar_recv_message(con, &mes, NULL) == -1 ) { … … 335 353 */ 336 354 337 if ( dir == ROAR_DIR_PLAY ) { 338 (void)ROAR_SHUTDOWN(fh, SHUT_RD); 339 } else if ( dir == ROAR_DIR_MONITOR || dir == ROAR_DIR_RECORD ) { 340 (void)ROAR_SHUTDOWN(fh, SHUT_WR); 355 if ( fh != -1 ) { 356 if ( dir == ROAR_DIR_PLAY ) { 357 (void)ROAR_SHUTDOWN(fh, SHUT_RD); 358 } else if ( dir == ROAR_DIR_MONITOR || dir == ROAR_DIR_RECORD ) { 359 (void)ROAR_SHUTDOWN(fh, SHUT_WR); 360 } 341 361 } 342 362
Note: See TracChangeset
for help on using the changeset viewer.