Changeset 1208:3ed0b4a1da52 in roaraudio


Ignore:
Timestamp:
02/04/09 17:46:44 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support to select a default codec for the default output driver

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • configure

    r1199 r1208  
    6161 
    6262ROAR_DRIVER_DEFAULT='' 
     63ROAR_DRIVER_CODEC='' 
    6364 
    6465echo -n "checking for C compiler... " 
     
    121122   echo '--default-bits BITS         - Set default number of bits per sample for roard and roarclients' 
    122123   echo '--default-driver DRIVER     - Set default driver for roard' 
     124   echo '--default-codec CODEC       - Set default codec used for the default driver' 
    123125   echo 
    124126   echo '--without-alaw              - Disable support of A-Law codec (de- and encoding)' 
     
    197199  '--default-driver') 
    198200   ROAR_DRIVER_DEFAULT="$2" 
     201   shift; 
     202  ;; 
     203  '--default-codec') 
     204   ROAR_DRIVER_CODEC="$2" 
    199205   shift; 
    200206  ;; 
     
    452458 [ "$DEFAULT_BITS"        = '' ] || echo "#define ROAR_BITS_DEFAULT     $DEFAULT_BITS" 
    453459 [ "$ROAR_DRIVER_DEFAULT" = '' ] || echo "#define ROAR_DRIVER_DEFAULT   \"$ROAR_DRIVER_DEFAULT\"" 
     460 [ "$ROAR_DRIVER_CODEC"   = '' ] || echo "#define ROAR_DRIVER_CODEC     \"$ROAR_DRIVER_CODEC\"" 
    454461 echo 
    455462 $ALAW     && echo '#define ROAR_SUPPORT_ALAW' 
  • roard/roard.c

    r1207 r1208  
    129129 struct roar_stream_server * ss; 
    130130 char * k, * v; 
     131#ifdef ROAR_DRIVER_CODEC 
     132 char * to_free = NULL; 
     133#endif 
    131134 int codec; 
    132135 int sync = 0; 
     
    138141  prim = 1; 
    139142  sync = 1; 
     143 
     144#ifdef ROAR_DRIVER_CODEC 
     145  if ( opts == NULL ) { 
     146   opts = to_free = strdup("codec=" ROAR_DRIVER_CODEC); 
     147  } 
     148#endif 
    140149 } 
    141150 
     
    177186    streams_delete(stream); 
    178187    if ( prim ) alive = 0; 
     188#ifdef ROAR_DRIVER_CODEC 
     189    if ( to_free != NULL ) 
     190     free(to_free); 
     191#endif 
    179192    return -1; 
    180193   } 
     
    187200   streams_delete(stream); 
    188201   if ( prim ) alive = 0; 
     202#ifdef ROAR_DRIVER_CODEC 
     203   if ( to_free != NULL ) 
     204    free(to_free); 
     205#endif 
    189206   return -1; 
    190207  } 
     
    192209  k = strtok(NULL, ","); 
    193210 } 
     211 
     212#ifdef ROAR_DRIVER_CODEC 
     213 if ( to_free != NULL ) 
     214  free(to_free); 
     215#endif 
    194216 
    195217 if ( codec == ROAR_CODEC_ALAW || codec == ROAR_CODEC_MULAW ) 
Note: See TracChangeset for help on using the changeset viewer.