Changeset 5257:27194d561c16 in roaraudio
- Timestamp:
- 11/13/11 22:53:53 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/vio_dstr.h
r5254 r5257 197 197 int roar_vio_open_default (struct roar_vio_calls * calls, struct roar_vio_defaults * def, char * opts); 198 198 199 int roar_vio_open_dstr_simple(struct roar_vio_calls * calls, const char * dstr, int o_flags); 200 199 201 int roar_vio_open_dstr (struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum); 200 202 int roar_vio_open_dstr_vio(struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum, struct roar_vio_calls * vio); -
libroar/vio_dstr.c
r5254 r5257 389 389 #endif 390 390 391 int roar_vio_open_dstr_simple(struct roar_vio_calls * calls, const char * dstr, int o_flags) { 392 struct roar_vio_defaults def; 393 394 if ( roar_vio_dstr_init_defaults(&def, ROAR_VIO_DEF_TYPE_NONE, o_flags, 0644) == -1 ) 395 return -1; 396 397 if ( roar_vio_open_dstr_vio(calls, dstr, &def, 1, NULL) == -1 ) 398 return -1; 399 400 return 0; 401 } 402 391 403 int roar_vio_open_dstr (struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum) { 392 404 return roar_vio_open_dstr_vio(calls, dstr, def, dnum, NULL); -
roard/roard.c
r5255 r5257 471 471 472 472 if ( pidfile != NULL ) { 473 if ( roar_vio_open_ file(&fh, pidfile, O_RDONLY, 0644) == -1) {473 if ( roar_vio_open_dstr_simple(&fh, pidfile, O_RDONLY) ) { 474 474 ROAR_WARN("restart_server(*): Can not read pidfile: %s", pidfile); 475 475 } else { … … 2519 2519 #ifdef SUPPORT_PIDFILE 2520 2520 if ( pidfile != NULL ) { 2521 if ( roar_vio_open_ file(&pidfile_vio, pidfile, O_WRONLY|O_CREAT, 0644) == -1 ) {2521 if ( roar_vio_open_dstr_simple(&pidfile_vio, pidfile, O_WRONLY|O_CREAT) == -1 ) { 2522 2522 ROAR_ERR("Can not write pidfile: %s", pidfile); 2523 2523 } else { -
roard/streams.c
r5256 r5257 1429 1429 if ( tsubsys == subsys || tsubsys == ROAR_SUBSYS_NONE ) { 1430 1430 if ( &(pmss->mixer) != &(ss->mixer) ) { 1431 roar_conv_volume(&(pmss->mixer), &(ss->mixer), ROAR_STREAM(pmss)->info.channels, ROAR_STREAM(ss)->info.channels); 1431 if ( roar_conv_volume(&(pmss->mixer), &(ss->mixer), 1432 ROAR_STREAM(pmss)->info.channels, ROAR_STREAM(ss)->info.channels) == -1 ) { 1433 ROAR_WARN("streams_set_mixer(id=%i): Can not convert mixer settings for stream %i", id, i); 1434 } 1432 1435 } 1433 1436 … … 1966 1969 } 1967 1970 1968 int stream_shift_buffer (int id, struct roar_buffer ** buf) {1969 struct roar_buffer * next;1970 1971 _CHECK_SID(id);1972 1973 if ( g_streams[id]->buffer == NULL ) {1974 *buf = NULL;1975 return 0;1976 }1977 1978 roar_buffer_get_next(g_streams[id]->buffer, &next);1979 1980 *buf = g_streams[id]->buffer;1981 g_streams[id]->buffer = next;1982 1983 return 0;1984 }1985 int stream_unshift_buffer (int id, struct roar_buffer * buf) {1986 _CHECK_SID(id);1987 1988 if ( g_streams[id]->buffer == NULL ) {1989 g_streams[id]->buffer = buf;1990 return 0;1991 }1992 1993 roar_buffer_clear_next(buf);1994 1995 roar_buffer_add(buf, g_streams[id]->buffer);1996 1997 g_streams[id]->buffer = buf;1998 1999 return 0;2000 }2001 2002 1971 int stream_outputbuffer_request(int id, struct roar_buffer ** buf, size_t len) { 2003 1972 register struct roar_stream_server * ss; … … 2286 2255 req = done; 2287 2256 2288 roar_buffer_get_data(b, &buf);2289 2257 } else { 2290 2258 req = codecfilter_read(ss->codecfilter_inst, ss->codecfilter, buf, req); … … 2294 2262 ROAR_DBG("streams_check(id=%i): got %i bytes", id, req); 2295 2263 2296 roar_buffer_set_len(b, req); 2297 2298 if ( stream_add_buffer(id, b) != -1 ) 2299 return 0; 2300 2301 ROAR_ERR("streams_check(id=%i): something is wrong, could not add buffer to stream!", id); 2264 if ( roar_buffer_set_len(b, req) != -1 ) { 2265 if ( stream_add_buffer(id, b) != -1 ) 2266 return 0; 2267 2268 ROAR_ERR("streams_check(id=%i): something is wrong, could not add buffer to stream!", id); 2269 } else { 2270 ROAR_ERR("streams_check(id=%i): something is wrong, could not set size of buffer!", id); 2271 } 2272 2302 2273 roar_buffer_free(b); 2303 2274 } else {
Note: See TracChangeset
for help on using the changeset viewer.