Changes in uspace/app/wavplay/dplay.c [205f1add:5f97ef44] in mainline
- File:
-
- 1 edited
-
uspace/app/wavplay/dplay.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/dplay.c
r205f1add r5f97ef44 42 42 #include <pcm/format.h> 43 43 #include <as.h> 44 #include < time.h>44 #include <sys/time.h> 45 45 #include <inttypes.h> 46 46 #include <stdbool.h> … … 242 242 243 243 #define DPRINTF(f, ...) \ 244 printf("%.2lld:%.6lld "f, time.tv_sec % 100, \ 245 NSEC2USEC(time.tv_nsec), __VA_ARGS__) 244 printf("%.2lu:%.6lu "f, time.tv_sec % 100, time.tv_usec, __VA_ARGS__) 246 245 247 246 /** … … 256 255 printf("Playing: %dHz, %s, %d channel(s).\n", pb->f.sampling_rate, 257 256 pcm_sample_format_str(pb->f.sample_format), pb->f.channels); 258 usec _t work_time = 50000; /* 50 ms */257 useconds_t work_time = 50000; /* 50 ms */ 259 258 bool started = false; 260 259 size_t pos = 0; 261 struct time spectime = { 0 };260 struct timeval time = { 0 }; 262 261 getuptime(&time); 263 262 while (true) { … … 304 303 } 305 304 const size_t to_play = buffer_occupied(pb, pos); 306 const usec_t usecs = pcm_format_size_to_usec(to_play, &pb->f); 305 const useconds_t usecs = 306 pcm_format_size_to_usec(to_play, &pb->f); 307 307 308 308 /* Compute delay time */ 309 const usec _t real_delay = (usecs > work_time) ?309 const useconds_t real_delay = (usecs > work_time) ? 310 310 usecs - work_time : 0; 311 DPRINTF("POS %zu: % lld usecs (%lld) to play %zu bytes.\n",311 DPRINTF("POS %zu: %u usecs (%u) to play %zu bytes.\n", 312 312 pos, usecs, real_delay, to_play); 313 313 if (real_delay)
Note:
See TracChangeset
for help on using the changeset viewer.
