Changeset 4909:6f58c1773cd0 in roaraudio


Ignore:
Timestamp:
05/07/11 17:09:13 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

make ckport clean

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarinterconnect.c

    r4885 r4909  
    2626/* ckport options: 
    2727 * ckport: ignore: ^roar_cdriver_oss$     -- For OSS streams 
    28  * ckport: ignore: ^roar_simple_stream$   -- For RoarAudio streams 
    29  * ckport: ignore: ^roar_socket_connect$  -- For PulseAudio Simple streams 
    3028 */ 
    3129 
     
    244242 struct roar_connection con[1]; 
    245243 struct roar_stream     stream[1]; 
     244 struct roar_vio_calls  vio; 
    246245#ifdef _HAVE_OSS 
    247  struct roar_vio_calls  vio; 
    248246 struct roar_audio_info info; 
    249247#endif 
     
    316314       return 2; 
    317315    } 
    318     rfh = roar_simple_stream(rate, channels, bits, codec, remote, tmp, "roarinterconnect"); 
     316    if ( roar_vio_simple_stream(&vio, rate, channels, bits, codec, remote, tmp, "roarinterconnect") == -1 ) { 
     317     fprintf(stderr, "Error: can not open RoarAudio stream to %s: %s\n", remote, roar_error2str(roar_error)); 
     318     return 2; 
     319    } 
     320    if ( roar_vio_ctl(&vio, ROAR_VIO_CTL_GET_FH, &rfh) == -1 ) { 
     321     fprintf(stderr, "Error: can not get filehandle for RoarAudio stream: %s\n", roar_error2str(roar_error)); 
     322     roar_vio_close(&vio); 
     323     return 2; 
     324    } 
    319325   break; 
    320326#ifdef _HAVE_OSS 
     
    341347    info.codec    = codec; 
    342348    if ( roar_cdriver_oss(&vio, "OSS", remote, &info, tmp) == -1 ) { 
    343      fprintf(stderr, "Error: can not open OSS device %s\n", remote); 
     349     fprintf(stderr, "Error: can not open OSS device %s: %s\n", remote, roar_error2str(roar_error)); 
    344350     return 2; 
    345351    } 
    346352    if ( roar_vio_ctl(&vio, ROAR_VIO_CTL_GET_FH, &rfh) == -1 ) { 
     353     fprintf(stderr, "Error: can not get filehandle for OSS device %s: %s\n", remote, roar_error2str(roar_error)); 
    347354     roar_vio_close(&vio); 
    348      fprintf(stderr, "Error: can not get filehandle for OSS device %s\n", remote); 
    349355     return 2; 
    350356    } 
     
    452458     rport = atoi(k); 
    453459    } else { 
    454      rport = 4712; 
    455     } 
    456     rfh = roar_socket_connect(remote, rport); 
     460     rport = ROAR_DEFAULT_PA_PORT; 
     461    } 
     462 
     463    if ( roar_vio_open_socket(&vio, remote, rport) == -1 ) { 
     464     fprintf(stderr, "Error: can not open socket for Simple stream: %s\n", roar_error2str(roar_error)); 
     465     return 2; 
     466    } 
     467 
     468    roar_vio_shutdown(&vio, tmp); 
     469 
     470    if ( roar_vio_ctl(&vio, ROAR_VIO_CTL_GET_FH, &rfh) == -1 ) { 
     471     fprintf(stderr, "Error: can not get filehandle for Simple stream: %s\n", roar_error2str(roar_error)); 
     472     roar_vio_close(&vio); 
     473     return 2; 
     474    } 
     475/* 
    457476    if ( tmp != -1 ) { 
    458477     ROAR_SHUTDOWN(rfh, tmp); 
    459478    } 
     479*/ 
    460480   break; 
    461481  default: 
     
    489509 } 
    490510 
    491  roar_simple_close(rfh); 
     511 switch (type & MT_MASK) { 
     512  case MT_ESD: 
     513    close(rfh); 
     514   break; 
     515  case MT_RSOUND: 
     516    roar_vio_open_fh_socket(&vio, rfh); 
     517  case MT_ROAR: 
     518  case MT_OSS: 
     519  case MT_SIMPLE: 
     520    roar_vio_close(&vio); 
     521   break; 
     522  default: 
     523    close(rfh); 
     524 } 
    492525 
    493526 if ( roar_stream_attach_simple(con, stream, 0) == -1 ) { 
Note: See TracChangeset for help on using the changeset viewer.