int
process (jack_nframes_t nframes, void *arg)
{
	jack_default_audio_sample_t *in, *out;
	int i;

	in = jack_port_get_buffer (input_port, nframes);
	out = jack_port_get_buffer (output_port, nframes);

	memcpy (out, in, sizeof (jack_default_audio_sample_t) * nframes);

	for (i = 0; i < loopsize; ++i) {
		fooey (nframes);
	}

	last_load = jack_cpu_load (client);

	if ((at_loop += nframes) >= at_loop_size) {
		if (last_load < 25.0f) {
			loopsize *= 2;
		} else if (last_load < 50.0f) {
			loopsize = (int) (1.5 * loopsize);
		} else if (last_load < 90.0f) {
			loopsize += (int) (0.10 * loopsize);
		} else if (last_load < 95.0f) {
			loopsize += (int) (0.05 * loopsize);
		} else {
			loopsize += (int) (0.001 * loopsize);
		}
		at_loop = 0;
		printf ("loopsize = %d\n", loopsize);
	}

	if (xrun_occured) {
		if (consecutive_xruns == 0) {
			first_xrun = last_load;
		}
		consecutive_xruns++;
	}

	xrun_occured = 0;

	if (consecutive_xruns >= 10) {
		fprintf (stderr, "Stopping with load = %f (first xrun at %f)\n", last_load, first_xrun);
		exit (0);
	}

	return 0;
}
Esempio n. 2
0
// CHECK-LABEL: define void @test3(
// CHECK: alloca %struct.Test3S, align 8
// CHECK: call void @fooey
// CHECK-NOT: memcpy
// CHECK: call void @test2a
// CHECK-NOT: memcpy
// CHECK: call void @test2a
void test3(struct Test3S a) {
  struct Test3S b = a;
  fooey();
  test2a(a);
  test2a(b);
}