Changeset 5257:27194d561c16 in roaraudio


Ignore:
Timestamp:
11/13/11 22:53:53 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fixed most warnings in roard

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/vio_dstr.h

    r5254 r5257  
    197197int     roar_vio_open_default (struct roar_vio_calls * calls, struct roar_vio_defaults * def, char * opts); 
    198198 
     199int     roar_vio_open_dstr_simple(struct roar_vio_calls * calls, const char * dstr, int o_flags); 
     200 
    199201int     roar_vio_open_dstr    (struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum); 
    200202int     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  
    389389#endif 
    390390 
     391int     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 
    391403int     roar_vio_open_dstr    (struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum) { 
    392404 return roar_vio_open_dstr_vio(calls, dstr, def, dnum, NULL); 
  • roard/roard.c

    r5255 r5257  
    471471 
    472472 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) ) { 
    474474   ROAR_WARN("restart_server(*): Can not read pidfile: %s", pidfile); 
    475475  } else { 
     
    25192519#ifdef SUPPORT_PIDFILE 
    25202520 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 ) { 
    25222522   ROAR_ERR("Can not write pidfile: %s", pidfile); 
    25232523  } else { 
  • roard/streams.c

    r5256 r5257  
    14291429     if ( tsubsys == subsys || tsubsys == ROAR_SUBSYS_NONE ) { 
    14301430      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       } 
    14321435      } 
    14331436 
     
    19661969} 
    19671970 
    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  
    20021971int stream_outputbuffer_request(int id, struct roar_buffer ** buf, size_t len) { 
    20031972 register struct roar_stream_server *  ss; 
     
    22862255  req = done; 
    22872256 
    2288   roar_buffer_get_data(b, &buf); 
    22892257 } else { 
    22902258  req = codecfilter_read(ss->codecfilter_inst, ss->codecfilter, buf, req); 
     
    22942262  ROAR_DBG("streams_check(id=%i): got %i bytes", id, req); 
    22952263 
    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 
    23022273  roar_buffer_free(b); 
    23032274 } else { 
Note: See TracChangeset for help on using the changeset viewer.