summaryrefslogtreecommitdiff
path: root/src/rmd_capture_sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rmd_capture_sound.c')
-rw-r--r--src/rmd_capture_sound.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rmd_capture_sound.c b/src/rmd_capture_sound.c
index 2719c60..76ccd4b 100644
--- a/src/rmd_capture_sound.c
+++ b/src/rmd_capture_sound.c
@@ -38,6 +38,7 @@
#include <sys/uio.h>
#include <unistd.h>
#include <stdlib.h>
+#include <time.h>
void *rmdCaptureSound(ProgData *pdata) {
@@ -46,7 +47,7 @@ void *rmdCaptureSound(ProgData *pdata) {
int frames = pdata->periodsize;
#endif
//start capturing only after first frame is taken
- usleep(pdata->frametime);
+ nanosleep(&(struct timespec){ .tv_nsec = pdata->frametime * 1000 }, NULL);
while (pdata->running) {
int sret = 0;
© All Rights Reserved