Changeset 205f1add in mainline for uspace/app/wavplay/dplay.c
- Timestamp:
- 2018-08-23T21:14:56Z (6 years ago)
- Children:
- f33c989e
- Parents:
- e2625b1a
- git-author:
- Jakub Jermar <jakub@…> (2018-08-21 21:58:52)
- git-committer:
- Jakub Jermar <jakub@…> (2018-08-23 21:14:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/dplay.c
re2625b1a r205f1add 42 42 #include <pcm/format.h> 43 43 #include <as.h> 44 #include < sys/time.h>44 #include <time.h> 45 45 #include <inttypes.h> 46 46 #include <stdbool.h> … … 242 242 243 243 #define DPRINTF(f, ...) \ 244 printf("%.2lu:%.6lu "f, time.tv_sec % 100, time.tv_usec, __VA_ARGS__) 244 printf("%.2lld:%.6lld "f, time.tv_sec % 100, \ 245 NSEC2USEC(time.tv_nsec), __VA_ARGS__) 245 246 246 247 /** … … 255 256 printf("Playing: %dHz, %s, %d channel(s).\n", pb->f.sampling_rate, 256 257 pcm_sample_format_str(pb->f.sample_format), pb->f.channels); 257 usec onds_t work_time = 50000; /* 50 ms */258 usec_t work_time = 50000; /* 50 ms */ 258 259 bool started = false; 259 260 size_t pos = 0; 260 struct time valtime = { 0 };261 struct timespec time = { 0 }; 261 262 getuptime(&time); 262 263 while (true) { … … 303 304 } 304 305 const size_t to_play = buffer_occupied(pb, pos); 305 const useconds_t usecs = 306 pcm_format_size_to_usec(to_play, &pb->f); 306 const usec_t usecs = pcm_format_size_to_usec(to_play, &pb->f); 307 307 308 308 /* Compute delay time */ 309 const usec onds_t real_delay = (usecs > work_time) ?309 const usec_t real_delay = (usecs > work_time) ? 310 310 usecs - work_time : 0; 311 DPRINTF("POS %zu: % u usecs (%u) to play %zu bytes.\n",311 DPRINTF("POS %zu: %lld usecs (%lld) 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.