From b79ceb26f08e1db90a0e3719d5ac7e19e7f285e4 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 18 May 2013 20:07:49 -0400 Subject: [PATCH] Abstract out usleep() call. --- theoraplay.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/theoraplay.c b/theoraplay.c index e2da84f..4d7ece4 100644 --- a/theoraplay.c +++ b/theoraplay.c @@ -19,8 +19,11 @@ #include #define THEORAPLAY_THREAD_T HANDLE #define THEORAPLAY_MUTEX_T HANDLE +#define sleepms(x) Sleep(x) #else #include +#include +#define sleepms(x) usleep((x) * 1000) #define THEORAPLAY_THREAD_T pthread_t #define THEORAPLAY_MUTEX_T pthread_mutex_t #endif @@ -530,7 +533,7 @@ static void WorkerThread(TheoraDecoder *ctx) go_on = !ctx->halt && (ctx->videocount >= ctx->maxframes); Mutex_Unlock(ctx->lock); if (go_on) - usleep(10000); + sleepms(10); } // while //printf("Awake!\n"); } // if