Changeset 1bd99785 in mainline
- Timestamp:
- 2013-03-16T14:44:05Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 39a379a
- Parents:
- 3e6a975a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/dplay.c
r3e6a975a r1bd99785 201 201 } 202 202 203 #define DPRINTF(f, ...) \ 204 printf("%.2lu:%.6lu "f, time.tv_sec % 100, time.tv_usec, __VA_ARGS__) 205 203 206 204 207 static void play(playback_t *pb) … … 209 212 printf("Playing: %dHz, %s, %d channel(s).\n", pb->f.sampling_rate, 210 213 pcm_sample_format_str(pb->f.sample_format), pb->f.channels); 211 useconds_t work_time = 50000; /* 10 ms */214 useconds_t work_time = 70000; /* 10 ms */ 212 215 bool started = false; 213 216 size_t pos = 0; 217 struct timeval time = { 0 }; 218 getuptime(&time); 214 219 do { 215 220 size_t available = buffer_avail(pb, pos); … … 218 223 min(available, buffer_remain(pb)), pb->source); 219 224 buffer_advance(pb, bytes); 220 printf("POS %zu: %zu bytes free in buffer, read %zu, wp %zu\n",225 DPRINTF("POS %zu: %zu bytes free in buffer, read %zu, wp %zu\n", 221 226 pos, available, bytes, pb->buffer.write_ptr - pb->buffer.base); 222 227 available -= bytes; … … 226 231 pb->source); 227 232 buffer_advance(pb, bytes); 228 printf("POS %zu: %zu bytes still free in buffer, read %zu, wp %zu\n",233 DPRINTF("POS %zu: %zu bytes still free in buffer, read %zu, wp %zu\n", 229 234 pos, available, bytes, pb->buffer.write_ptr - pb->buffer.base); 230 235 available -= bytes; … … 247 252 const useconds_t real_delay = (usecs > work_time) 248 253 ? usecs - work_time : 0; 249 printf("POS %zu: %u usecs (%u) to play %zu bytes.\n",254 DPRINTF("POS %zu: %u usecs (%u) to play %zu bytes.\n", 250 255 pos, usecs, real_delay, to_play); 251 256 if (real_delay) … … 255 260 printf("Failed to update position indicator\n"); 256 261 } 262 getuptime(&time); 257 263 if (available) 258 264 break; … … 298 304 printf("Buffer: %p %zu.\n", pb.buffer.base, pb.buffer.size); 299 305 300 {301 uintptr_t ptr = 0;302 as_get_physical_mapping(pb.buffer.base, &ptr);303 printf("buffer mapped at %x.\n", ptr);304 }305 306 306 pb.source = fopen(file, "rb"); 307 307 if (pb.source == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.