1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
--- Csound5.13.0/Top/csound.c.orig 2011-04-07 10:36:19.738489172 +0100
+++ Csound5.13.0/Top/csound.c 2011-04-07 10:41:09.834581223 +0100
@@ -1382,6 +1382,10 @@
{
int done;
int returnValue;
+ /* WTB - Oct 15 2009: only perform if CS_STATE_COMP set. */
+ if (UNLIKELY((csound->engineState & CS_STATE_COMP) == 0)) {
+ return 1;
+ }
/* setup jmp for return after an exit() */
if ((returnValue = setjmp(csound->exitjmp))) {
#ifndef MACOSX
@@ -1402,6 +1406,10 @@
{
int done = 0;
int returnValue;
+ /* WTB - Oct 15 2009: only perform if CS_STATE_COMP set. */
+ if (UNLIKELY((csound->engineState & CS_STATE_COMP) == 0)) {
+ return 1;
+ }
/* setup jmp for return after an exit() */
if ((returnValue = setjmp(csound->exitjmp))) {
#ifndef MACOSX
@@ -1447,6 +1455,10 @@
int done;
int returnValue;
csound->performState = 0;
+ /* WTB - Oct 15 2009: only perform if CS_STATE_COMP set. */
+ if (UNLIKELY((csound->engineState & CS_STATE_COMP) == 0)) {
+ return 1;
+ }
/* setup jmp for return after an exit() */
if ((returnValue = setjmp(csound->exitjmp))) {
#ifndef MACOSX
--- Csound5.13.0/Top/main.c.orig 2011-04-07 10:36:24.745611983 +0100
+++ Csound5.13.0/Top/main.c 2011-04-07 10:43:02.001313569 +0100
@@ -89,7 +89,9 @@
dbfs_init(csound, DFLT_DBFS);
csound->csRtClock = (RTCLOCK*) csound->Calloc(csound, sizeof(RTCLOCK));
csoundInitTimerStruct(csound->csRtClock);
- csound->engineState |= CS_STATE_COMP | CS_STATE_CLN;
+ /* WTB - Oct 15 2009: only set CS_STATE_CLN; CS_STATE_COMP set when retval=0. */
+ csound->engineState |= /*CS_STATE_COMP |*/ CS_STATE_CLN;
+
#ifndef USE_DOUBLE
#ifdef BETA
@@ -409,6 +411,13 @@
if (O->Midioutname != NULL || O->FMidioutname != NULL)
openMIDIout(csound);
- return musmon(csound);
+ n = musmon(csound);
+
+ /* WTB - Oct 15 2009: CS_STATE_COMP set when retval=0. */
+ if (n == 0) {
+ csound->engineState |= CS_STATE_COMP;
+ }
+
+ return n;
}
|