Changeset b7fd2a0 in mainline for uspace/app/wavplay
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/app/wavplay
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/dplay.c
r36f0738 rb7fd2a0 148 148 const size_t fragment_size = pb->buffer.size / DEFAULT_FRAGMENTS; 149 149 printf("Registering event callback\n"); 150 int ret = audio_pcm_register_event_callback(pb->device,150 errno_t ret = audio_pcm_register_event_callback(pb->device, 151 151 device_event_callback, pb); 152 152 if (ret != EOK) { … … 282 282 283 283 if (!started) { 284 int ret = audio_pcm_start_playback(pb->device,284 errno_t ret = audio_pcm_start_playback(pb->device, 285 285 pb->f.channels, pb->f.sampling_rate, 286 286 pb->f.sample_format); … … 309 309 async_usleep(real_delay); 310 310 /* update buffer position */ 311 const int ret = audio_pcm_get_buffer_pos(pb->device, &pos);311 const errno_t ret = audio_pcm_get_buffer_pos(pb->device, &pos); 312 312 if (ret != EOK) { 313 313 printf("Failed to update position indicator %s\n", … … 333 333 int dplay(const char *device, const char *file) 334 334 { 335 int ret = EOK;335 errno_t ret = EOK; 336 336 audio_pcm_sess_t *session = NULL; 337 337 if (str_cmp(device, "default") == 0) { -
uspace/app/wavplay/drec.c
r36f0738 rb7fd2a0 139 139 assert(rec); 140 140 assert(rec->device); 141 int ret = audio_pcm_register_event_callback(rec->device,141 errno_t ret = audio_pcm_register_event_callback(rec->device, 142 142 device_event_callback, rec); 143 143 if (ret != EOK) { … … 174 174 int drecord(const char *device, const char *file) 175 175 { 176 int ret = EOK;176 errno_t ret = EOK; 177 177 audio_pcm_sess_t *session = NULL; 178 178 sysarg_t val; -
uspace/app/wavplay/main.c
r36f0738 rb7fd2a0 57 57 * @return Error code. 58 58 */ 59 static int hplay_ctx(hound_context_t *ctx, const char *filename)59 static errno_t hplay_ctx(hound_context_t *ctx, const char *filename) 60 60 { 61 61 printf("Hound context playback: %s\n", filename); … … 76 76 pcm_format_t format; 77 77 const char *error; 78 int ret = wav_parse_header(&header, NULL, NULL, &format.channels,78 errno_t ret = wav_parse_header(&header, NULL, NULL, &format.channels, 79 79 &format.sampling_rate, &format.sample_format, &error); 80 80 if (ret != EOK) { … … 118 118 * @return Error code 119 119 */ 120 static int hplay(const char *filename)120 static errno_t hplay(const char *filename) 121 121 { 122 122 printf("Hound playback: %s\n", filename); … … 137 137 pcm_format_t format; 138 138 const char *error; 139 int ret = wav_parse_header(&header, NULL, NULL, &format.channels,139 errno_t ret = wav_parse_header(&header, NULL, NULL, &format.channels, 140 140 &format.sampling_rate, &format.sample_format, &error); 141 141 if (ret != EOK) { … … 197 197 * @return Error code. 198 198 */ 199 static int play_wrapper(void *arg)199 static errno_t play_wrapper(void *arg) 200 200 { 201 201 assert(arg); 202 202 fib_play_t *p = arg; 203 const int ret = hplay_ctx(p->ctx, p->file);203 const errno_t ret = hplay_ctx(p->ctx, p->file); 204 204 atomic_dec(p->count); 205 205 free(arg); … … 289 289 return 1; 290 290 } 291 const int ret = hound_context_connect_target(hound_ctx,291 const errno_t ret = hound_context_connect_target(hound_ctx, 292 292 HOUND_DEFAULT_TARGET); 293 293 if (ret != EOK) { -
uspace/app/wavplay/wave.c
r36f0738 rb7fd2a0 52 52 * Does sanity checks and endian conversion. 53 53 */ 54 int wav_parse_header(const void *hdata, const void **data, size_t *data_size,54 errno_t wav_parse_header(const void *hdata, const void **data, size_t *data_size, 55 55 unsigned *channels, unsigned *sampling_rate, pcm_sample_format_t *format, 56 56 const char **error) -
uspace/app/wavplay/wave.h
r36f0738 rb7fd2a0 90 90 } wave_header_t; 91 91 92 int wav_parse_header(const void *, const void**, size_t *, unsigned *,92 errno_t wav_parse_header(const void *, const void**, size_t *, unsigned *, 93 93 unsigned *, pcm_sample_format_t *, const char **); 94 94
Note:
See TracChangeset
for help on using the changeset viewer.
