1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-12 13:36:45 +02:00

Replace deprecated usleep function with nanosleep

usleep was declared obsolete in POSIX.1-2001
This commit is contained in:
jfreegman
2020-11-03 12:17:48 -05:00
parent f64300d1d6
commit 42763905d7
7 changed files with 32 additions and 13 deletions

View File

@ -258,7 +258,7 @@ VideoDeviceError terminate_video_devices(void)
video_thread_running = false;
unlock;
usleep(20000);
sleep_thread(20000L);
int i;
@ -676,7 +676,7 @@ void *video_thread_poll(void *arg) // TODO: maybe use thread for every input so
unlock;
if (video_thread_paused) {
usleep(10000); /* Wait for unpause. */
sleep_thread(10000L); /* Wait for unpause. */
} else {
for (i = 0; i < size[vdt_input]; ++i) {
lock;
@ -765,7 +765,8 @@ void *video_thread_poll(void *arg) // TODO: maybe use thread for every input so
unlock;
}
usleep(1000 * 1000 / 24);
long int sleep_duration = 1000 * 1000 / 24;
sleep_thread(sleep_duration);
}
}