Changeset 5056:b31e60545552 in roaraudio for roard/driver_pulsesimple.c
- Timestamp:
- 06/02/11 23:13:11 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/driver_pulsesimple.c
r5012 r5056 34 34 pa_stream_direction_t dir = PA_STREAM_PLAYBACK; 35 35 pa_sample_spec ss; 36 int autoconfig = 0; 37 int needauto = 0; 36 38 37 39 // pa_sample_format_t format; /**< The sample format */ 40 41 if ( fh != -1 ) 42 return -1; 43 44 if ( sstream != NULL ) { 45 autoconfig = streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF); 46 } 38 47 39 48 switch (info->codec) { … … 50 59 break; 51 60 default: 52 return -1;61 needauto = 1; 53 62 break; 54 63 } … … 60 69 break; 61 70 default: 62 return -1;71 needauto = 1; 63 72 break; 64 73 } … … 70 79 ss.format = PA_SAMPLE_U8; 71 80 } else { 72 return -1;81 needauto = 1; 73 82 } 74 83 break; 75 84 default: 76 return -1;85 needauto = 1; 77 86 break; 87 } 88 89 if ( needauto ) { 90 if ( !autoconfig ) { 91 return -1; 92 } 93 94 info->bits = 16; 95 info->codec = ROAR_CODEC_DEFAULT; 96 ss.format = PA_SAMPLE_S16NE; 78 97 } 79 98 … … 85 104 86 105 self->handle = pa_simple_new(device, "roard", dir, subdev, "RoarAudio Sound Server", &ss, NULL, NULL, &pulseerror); 106 107 if ( self->handle == NULL && autoconfig ) { 108 info->bits = 16; 109 info->codec = ROAR_CODEC_DEFAULT; 110 ss.format = PA_SAMPLE_S16NE; 111 112 self->handle = pa_simple_new(device, "roard", dir, subdev, "RoarAudio Sound Server", &ss, NULL, NULL, &pulseerror); 113 } 87 114 88 115 if ( self->handle == NULL ) {
Note: See TracChangeset
for help on using the changeset viewer.