Changes in uspace/app/wavplay/drec.c [33b8d024:0e4c5f0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/drec.c
r33b8d024 r0e4c5f0 42 42 #include <as.h> 43 43 #include <inttypes.h> 44 #include <str.h>45 44 46 45 #include "wave.h" … … 140 139 assert(rec); 141 140 assert(rec->device); 142 errno_t ret = audio_pcm_register_event_callback(rec->device,141 int ret = audio_pcm_register_event_callback(rec->device, 143 142 device_event_callback, rec); 144 143 if (ret != EOK) { … … 171 170 * @param device The device. 172 171 * @param file The file. 173 * @return 0 on succes, non-zero on failure.172 * @return Error code. 174 173 */ 175 174 int drecord(const char *device, const char *file) 176 175 { 177 errno_t ret = EOK;176 int ret = EOK; 178 177 audio_pcm_sess_t *session = NULL; 179 sysarg_t val;180 178 if (str_cmp(device, "default") == 0) { 181 179 session = audio_pcm_open_default(); … … 188 186 } 189 187 printf("Recording on device: %s.\n", device); 190 ret = audio_pcm_query_cap(session, AUDIO_CAP_CAPTURE, &val); 191 if (ret != EOK || !val) { 188 if (audio_pcm_query_cap(session, AUDIO_CAP_CAPTURE) <= 0) { 192 189 printf("Device %s does not support recording\n", device); 193 190 ret = ENOTSUP; … … 195 192 } 196 193 197 c har* info = NULL;194 const char* info = NULL; 198 195 ret = audio_pcm_get_info_str(session, &info); 199 196 if (ret != EOK) { … … 228 225 goto cleanup; 229 226 } 230 ret = audio_pcm_query_cap(rec.device, AUDIO_CAP_INTERRUPT, &val); 231 if (ret == EOK && val) 227 if (audio_pcm_query_cap(rec.device, AUDIO_CAP_INTERRUPT) > 0) 232 228 record_fragment(&rec, format); 233 229 else
Note:
See TracChangeset
for help on using the changeset viewer.