Changeset 1913:b4b824af799b in roaraudio
- Timestamp:
- 05/26/09 23:06:36 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/include/streams.h
r1857 r1913 73 73 uint_least32_t delay; 74 74 char * name; 75 int ready; 75 76 } * g_streams[ROAR_STREAMS_MAX]; 76 77 -
roard/streams.c
r1912 r1913 94 94 s->codec_orgi = -1; 95 95 s->primary = 0; 96 s->ready = 0; 96 97 97 98 s->mixer.scale = 65535; … … 255 256 int streams_set_fh (int id, int fh) { 256 257 struct roar_stream_server * ss; 258 struct roar_stream * s; 257 259 int dir; 258 260 259 if ( (s s = g_streams[id]) == NULL )260 return -1; 261 262 ROAR_DBG("streams_set_fh(id=%i): g_streams[id]->id=%i", id, ROAR_STREAM(ss)->id);263 264 ROAR_STREAM(g_streams[id])->fh = fh;261 if ( (s = ROAR_STREAM(ss = g_streams[id])) == NULL ) 262 return -1; 263 264 ROAR_DBG("streams_set_fh(id=%i): g_streams[id]->id=%i", id, s->id); 265 266 s->fh = fh; 265 267 266 268 ROAR_DBG("streams_set_fh(id=%i, fh=%i): driverID=%i", id, fh, ss->driver_id); … … 270 272 271 273 if ( codecfilter_open(&(ss->codecfilter_inst), &(ss->codecfilter), NULL, 272 ROAR_STREAM(ss)->info.codec, ss) == -1 ) {273 return streams_delete(id); 274 s->info.codec, ss) == -1 ) { 275 return streams_delete(id); // TODO: FIXME: is this correct? shoudn't we return -1 in any case here? 274 276 } 275 277 … … 283 285 fh = -2; 284 286 } else { 285 ROAR_STREAM(g_streams[id])->fh = fh;287 s->fh = fh; 286 288 } 287 289 } … … 289 291 290 292 if ( fh == -1 || fh == -2 ) { // yes, this is valid, indecats full vio! 293 ss->ready = 1; 291 294 return 0; 292 295 } … … 307 310 308 311 if ( dir == ROAR_DIR_FILTER ) { 312 ss->ready = 1; 309 313 return 0; 310 314 } else { 311 return roar_socket_nonblock(fh, ROAR_SOCKET_NONBLOCK); 315 if ( roar_socket_nonblock(fh, ROAR_SOCKET_NONBLOCK) == -1 ) 316 return -1; 317 318 ss->ready = 1; 319 return 0; 312 320 } 313 321 }
Note: See TracChangeset
for help on using the changeset viewer.