Changeset 3bacee1 in mainline for uspace/app/wavplay/dplay.c
- Timestamp:
- 2018-04-12T16:27:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/dplay.c
r76d0981d r3bacee1 58 58 void *base; 59 59 size_t size; 60 void *write_ptr;60 void *write_ptr; 61 61 } buffer; 62 62 pcm_format_t f; 63 FILE *source;63 FILE *source; 64 64 volatile bool playing; 65 65 fibril_mutex_t mutex; … … 104 104 ipc_call_t call; 105 105 cap_call_handle_t chandle = async_get_call(&call); 106 switch (IPC_GET_IMETHOD(call)) {106 switch (IPC_GET_IMETHOD(call)) { 107 107 case PCM_EVENT_PLAYBACK_STARTED: 108 108 case PCM_EVENT_FRAMES_PLAYED: … … 125 125 } 126 126 const size_t bytes = fread(pb->buffer.write_ptr, 127 sizeof(uint8_t), fragment_size, pb->source);127 sizeof(uint8_t), fragment_size, pb->source); 128 128 printf("Copied from position %p size %zu/%zu\n", 129 129 pb->buffer.write_ptr, bytes, fragment_size); … … 297 297 if (ret != EOK) { 298 298 printf("Failed to update position indicator " 299 "%s\n", str_error(ret));299 "%s\n", str_error(ret)); 300 300 } 301 301 } … … 305 305 306 306 /* Compute delay time */ 307 const useconds_t real_delay = (usecs > work_time) 308 ?usecs - work_time : 0;307 const useconds_t real_delay = (usecs > work_time) ? 308 usecs - work_time : 0; 309 309 DPRINTF("POS %zu: %u usecs (%u) to play %zu bytes.\n", 310 310 pos, usecs, real_delay, to_play); … … 356 356 } 357 357 358 char *info = NULL;358 char *info = NULL; 359 359 ret = audio_pcm_get_info_str(session, &info); 360 360 if (ret != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.