Changeset c891eaca in mainline
- Timestamp:
- 2011-12-07T14:04:34Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 46d9d13
- Parents:
- 7a5ab20
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/dplay/dplay.c
r7a5ab20 rc891eaca 56 56 { 57 57 assert(device); 58 const size_t half_buf = size / 2;58 const size_t update_size = size / 8; 59 59 60 60 /* Time to play half the buffer. */ 61 61 const suseconds_t interval = 1000000 / 62 (sampling_rate / ( half_buf/ (channels * (sample_size / 8))));62 (sampling_rate / (update_size / (channels * (sample_size / 8)))); 63 63 printf("Time to play half buffer: %ld us.\n", interval); 64 64 /* Initialize buffer. */ … … 88 88 89 89 const size_t bytes = 90 fread(buffer_place, sizeof(uint8_t), half_buf, source);90 fread(buffer_place, sizeof(uint8_t), update_size, source); 91 91 if (bytes == 0) 92 92 break; 93 if (bytes < half_buf) {94 bzero(buffer_place + bytes, half_buf- bytes);93 if (bytes < update_size) { 94 bzero(buffer_place + bytes, update_size - bytes); 95 95 } 96 if (buffer_place == buffer) {97 buffer_place = buffer + half_buf; 98 } else{96 buffer_place += update_size; 97 98 if (buffer_place == buffer + size) { 99 99 buffer_place = buffer; 100 100 }
Note:
See TracChangeset
for help on using the changeset viewer.