aboutsummaryrefslogtreecommitdiff
path: root/externals/extra/pd~
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-09-21 22:26:13 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-09-21 22:26:13 +0000
commit503db98543e47045ed6a3465b0bdabcbb01d2b01 (patch)
tree31d27b178d7b651d1935db957fe7fa391d6156e6 /externals/extra/pd~
parent6b418a345a18f15a592ff65de48d4fd755cf3daa (diff)
updated from pure-data.git v0.43.1test4
svn path=/trunk/; revision=15336
Diffstat (limited to 'externals/extra/pd~')
-rw-r--r--externals/extra/pd~/pdsched.c20
-rw-r--r--externals/extra/pd~/pd~.c3
2 files changed, 23 insertions, 0 deletions
diff --git a/externals/extra/pd~/pdsched.c b/externals/extra/pd~/pdsched.c
index d1d079db..6c6060c1 100644
--- a/externals/extra/pd~/pdsched.c
+++ b/externals/extra/pd~/pdsched.c
@@ -17,6 +17,23 @@ outputs audio and messages. */
#define BUFSIZE 65536
static char inbuf[BUFSIZE];
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+void glob_watchdog(t_pd *dummy);
+
+static void pollwatchdog( void)
+{
+ static int sched_diddsp, sched_nextpingtime;
+ sched_diddsp++;
+ if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0))
+ {
+ glob_watchdog(0);
+ /* ping every 2 seconds */
+ sched_nextpingtime = sched_diddsp +
+ 2 * (int)(sys_dacsr /(double)sys_schedblocksize);
+ }
+}
+#endif
+
int pd_extern_sched(char *flags)
{
int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV];
@@ -58,6 +75,9 @@ int pd_extern_sched(char *flags)
*fp++ = 0;
sched_tick(sys_time+sys_time_per_dsp_tick);
sys_pollgui();
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+ pollwatchdog();
+#endif
printf(";\n");
for (i = chout*DEFDACBLKSIZE, fp = sys_soundout; i--; fp++)
{
diff --git a/externals/extra/pd~/pd~.c b/externals/extra/pd~/pd~.c
index dc2eca4c..8a1f5c39 100644
--- a/externals/extra/pd~/pd~.c
+++ b/externals/extra/pd~/pd~.c
@@ -14,6 +14,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
+#include <fcntl.h>
#ifdef _MSC_VER
#pragma warning (disable: 4305 4244)
@@ -252,6 +253,8 @@ static void pd_tilde_donew(t_pd_tilde *x, char *pddir, char *schedlibdir,
/* OK, we're parent */
close(pipe1[0]);
close(pipe2[1]);
+ fcntl(pipe1[1], F_SETFD, FD_CLOEXEC);
+ fcntl(pipe2[0], F_SETFD, FD_CLOEXEC);
x->x_outfd = fdopen(pipe1[1], "w");
x->x_infd = fdopen(pipe2[0], "r");
x->x_childpid = pid;