992a95f9bf
not only be able to save text to speech in wav file) - rework the src Makefile - use system portaudio.h instead of the bundled one
35 lines
1017 B
Plaintext
35 lines
1017 B
Plaintext
$OpenBSD: patch-src_fifo_cpp,v 1.1 2009/04/16 16:39:17 ajacoutot Exp $
|
|
--- src/fifo.cpp.orig Mon Dec 22 23:36:40 2008
|
|
+++ src/fifo.cpp Thu Apr 16 18:20:58 2009
|
|
@@ -39,6 +39,12 @@
|
|
#include "wave.h"
|
|
#include "debug.h"
|
|
|
|
+#ifndef timespeccmp
|
|
+#define timespeccmp(tvp, uvp, cmp) \
|
|
+ (((tvp)->tv_sec == (uvp)->tv_sec) ? \
|
|
+ ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \
|
|
+ ((tvp)->tv_sec cmp (uvp)->tv_sec))
|
|
+#endif
|
|
|
|
//>
|
|
//<decls and function prototypes
|
|
@@ -306,10 +312,14 @@ static int sleep_until_start_request_or_inactivity()
|
|
to.tv_sec, to.tv_nsec,
|
|
ts.tv_sec, ts.tv_nsec);
|
|
|
|
- while ((err = sem_timedwait(&my_sem_start_is_required, &ts)) == -1
|
|
- && errno == EINTR)
|
|
+ while ((err = sem_trywait(&my_sem_start_is_required)) == -1
|
|
+ && (errno == EINTR || errno == EAGAIN))
|
|
{
|
|
- continue;
|
|
+ struct timespec help;
|
|
+ clock_gettime2(&help);
|
|
+ if (timespeccmp(&help, &ts, >=))
|
|
+ break;
|
|
+ sched_yield();
|
|
}
|
|
|
|
assert (gettimeofday(&tv, NULL) != -1);
|