Changeset 3144:f8cd1e36b390 in roaraudio
- Timestamp:
- 01/15/10 13:09:40 (14 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroaross
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libroaross/Makefile
r3139 r3144 7 7 OBJS=libroaross.o 8 8 9 #DEFINES = -DDEBUG9 DEFINES = -DDEBUG 10 10 INCLUDE = -I../include -I../include/libroar 11 11 CFLAGS += -g -Wall -O2 $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) -
libroaross/libroaross.c
r3143 r3144 84 84 struct roar_stream stream; 85 85 struct roar_vio_calls stream_vio; 86 int stream_dir; 86 87 int stream_opened; 87 88 }; … … 157 158 session->refc--; 158 159 160 ROAR_DBG("_close_session(session=%p): session->refc=%i", session, session->refc); 161 159 162 if ( session->refc == 0 ) { 160 163 roar_disconnect(&(session->con)); … … 174 177 session->refc++; // TODO: better warp this 175 178 handle->type = HT_NONE; 176 roar_stream_new_empty(&(handle->stream)); 179 handle->stream_dir = ROAR_DIR_PLAY; 180 roar_stream_new(&(handle->stream), ROAR_RATE_DEFAULT, ROAR_CHANNELS_DEFAULT, ROAR_BITS_DEFAULT, ROAR_CODEC_DEFAULT); 177 181 178 182 return handle; … … 185 189 handle->refc--; 186 190 191 ROAR_DBG("_close_handle(handle=%p): handle->refc=%i", handle, handle->refc); 192 187 193 if ( handle->refc == 0 ) { 188 _close_session(handle->session);189 190 194 if ( handle->stream_opened ) 191 195 roar_vio_close(&(handle->stream_vio)); 192 196 197 handle->session->refc--; 198 199 _close_session(handle->session); 200 193 201 roar_mm_free(handle); 194 202 } 195 }196 197 static int _open_stream (struct handle * handle) {198 return -1;199 203 } 200 204 … … 261 265 return -2; 262 266 263 _os.write(1, "DOOF!\n", 6);264 265 267 if ( (session = _open_session(NULL, NULL)) == NULL ) { 266 268 return -1; … … 280 282 281 283 return pointer->fh; 284 } 285 286 // ------------------------------------- 287 // open function for streams: 288 // ------------------------------------- 289 290 static int _open_stream (struct handle * handle) { 291 // FIXME: this should be re-written much more cleanly: 292 293 if ( handle == NULL ) 294 return -1; 295 296 if ( roar_vio_simple_new_stream_obj(&(handle->stream_vio), 297 &(handle->session->con), &(handle->stream), 298 handle->stream.info.rate, 299 handle->stream.info.channels, 300 handle->stream.info.bits, 301 handle->stream.info.codec, 302 handle->stream_dir 303 ) == -1 ) 304 return -1; 305 306 handle->stream_opened++; 307 308 return 0; 282 309 } 283 310
Note: See TracChangeset
for help on using the changeset viewer.