Changeset 3922:830e86ab2ec8 in roaraudio


Ignore:
Timestamp:
06/09/10 09:51:36 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added exec feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarrsound/libroarrsound.c

    r3919 r3922  
    266266} 
    267267 
     268/* Shuts down the rsound data structures, but returns the file descriptor associated with the connection. 
     269   The control socket will be shut down. If this function returns a negative number, the exec failed, 
     270   but the data structures will not be teared down. 
     271   Should a valid file descriptor be returned, it will always be non-blocking.  <<-- FIXME? */ 
     272int rsd_exec (rsound_t *rd) { 
     273 struct libroarrsound * self = (struct libroarrsound *)rd; 
     274 int fh; 
     275 
     276 if ( !(self->flags & LIBROARRSOUND_FLAGS_STREAMING) ) 
     277  if ( rsd_start(rd) == -1 ) 
     278   return -1; 
     279 
     280 if ( roar_vio_ctl(&(self->vio), ROAR_VIO_CTL_GET_FH, &fh) == -1 ) 
     281  return -1; 
     282 
     283 if ( fh == -1 ) 
     284  return -1; 
     285 
     286 if ( roar_stream_exec(&(self->con), &(self->stream)) == -1 ) 
     287  return -1; 
     288 
     289 // reset flags: 
     290 if ( self->flags & LIBROARRSOUND_FLAGS_CONNECTED ) 
     291  self->flags -= LIBROARRSOUND_FLAGS_CONNECTED; 
     292 
     293 if ( self->flags & LIBROARRSOUND_FLAGS_STREAMING ) 
     294  self->flags -= LIBROARRSOUND_FLAGS_STREAMING; 
     295 
     296 // we hope nothing goes wrong here: 
     297 rsd_free(rd); 
     298 
     299 return fh; 
     300} 
     301 
    268302/* Disconnects from server. All audio data still in network buffer and other buffers will be dropped. 
    269303   To continue playing, you will need to rsd_start() again. */ 
Note: See TracChangeset for help on using the changeset viewer.