From 193a1e77bf798ef2ce2a1546d845f3bfe6ab3928 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 12 Jul 2020 11:14:30 -0700 Subject: *: standardize sleeps on nanosleep() usleep() is deprecated by posix in favor of nanosleep(), nanosleep doesn't dick with signals so it's generally better anyways. --- src/rmd_capture_sound.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/rmd_capture_sound.c') 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 #include #include +#include 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; -- cgit v1.2.3