Changeset 5056:b31e60545552 in roaraudio for roard/driver_ao.c
- Timestamp:
- 06/02/11 23:13:11 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/driver_ao.c
r5012 r5056 32 32 if ( _driver_ao_usage_counter++ == 0 ) 33 33 ao_initialize(); 34 35 #ifdef ROAR_HAVE_AO_APPEND_GLOBAL_OPTION 36 ao_append_global_option("client_name", "roard"); 37 #endif 34 38 } 35 39 … … 44 48 ao_sample_format format; 45 49 int driver; 50 int autoconfig = 0; 46 51 47 52 ROAR_WARN("The libao driver is obsolete, use another!"); … … 49 54 if ( fh != -1 ) 50 55 return -1; 56 57 if ( sstream != NULL ) { 58 autoconfig = streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF); 59 } 51 60 52 61 driver_ao_init(); … … 94 103 break; 95 104 default: 96 ROAR_ERR("Can not open audio device via libao: codec not supported. You may want to try -oO codec=pcm"); 97 driver_ao_uninit(); 98 return -1; 99 break; 105 if ( autoconfig ) { 106 format.byte_format = AO_FMT_NATIVE; 107 info->codec = ROAR_CODEC_DEFAULT; 108 } else { 109 ROAR_ERR("Can not open audio device via libao: codec not supported. You may want to try -oO codec=pcm"); 110 driver_ao_uninit(); 111 return -1; 112 } 113 break; 100 114 } 101 115 102 116 aodevice = ao_open_live(driver, &format, NULL /* no options */); 117 118 if ( aodevice == NULL && autoconfig ) { 119 format.byte_format = AO_FMT_NATIVE; 120 format.bits = 16; 121 info->codec = ROAR_CODEC_DEFAULT; 122 info->bits = 16; 123 aodevice = ao_open_live(driver, &format, NULL /* no options */); 124 } 103 125 104 126 if ( aodevice == NULL ) {
Note: See TracChangeset
for help on using the changeset viewer.