Changeset 4664:fd2cbe7b3893 in roaraudio


Ignore:
Timestamp:
12/15/10 02:26:07 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support for automatic codec detection in case _MIMETYPE is supported

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarcatvio.c

    r3812 r4664  
    4747 int    bits     = ROAR_BITS_DEFAULT; 
    4848 int    channels = ROAR_CHANNELS_DEFAULT; 
    49  int    codec    = ROAR_CODEC_DEFAULT; 
     49 int    codec    = -1; 
    5050 char * server   = NULL; 
    5151 char * k; 
     
    5555 struct roar_vio_defaults def; 
    5656 int file_opened = 0; 
     57 const char * content_type; 
    5758 
    5859 if ( roar_vio_open_fh(&file, ROAR_STDIN) == -1 ) 
     
    9091    return 1; 
    9192   } 
     93 
     94   if ( codec == -1 ) { 
     95    if ( roar_vio_ctl(&file, ROAR_VIO_CTL_GET_MIMETYPE, &content_type) != -1 ) { 
     96     codec = roar_mime2codec(content_type); 
     97    } 
     98   } 
    9299  } else { 
    93100   fprintf(stderr, "Error: unknown argument: %s\n", k); 
     
    96103  } 
    97104 } 
     105 
     106 if ( codec == -1 ) 
     107  codec = ROAR_CODEC_DEFAULT; 
    98108 
    99109 if ( roar_vio_simple_stream(&stream, rate, channels, bits, codec, server, ROAR_DIR_PLAY, name) == -1 ) { 
Note: See TracChangeset for help on using the changeset viewer.