1 // needed to use RTLD_NEXT from dlfcn.h
12 #define ABORT_ON_VIOLATION 1
14 // is set to 'true' when entering the process-callback and to 'false' when
15 // leaving it. When set to 'true', calls to non-realtime functions will
16 // cause warnings/errors.
18 // This assumes there is only 1 thread running at a time, thus introducing
19 // the limitation that jack_interposer is only usable on single-CPU machines
20 // (or machines configured to run the application under test on only 1 CPU).
26 JackProcessCallback real_process_callback
;
28 int interposed_process_callback(jack_nframes_t nframes
, void* arg
)
34 result
= real_process_callback(nframes
, arg
);
41 int jack_set_process_callback(jack_client_t
* client
,
42 JackProcessCallback process_callback
, void* arg
)
44 static int (*func
)() = NULL
;
48 func
= (int(*)()) dlsym(RTLD_NEXT
, "jack_set_process_callback");
51 fprintf(stderr
, "Error dlsym'ing jack_set_process_callback\n");
55 real_process_callback
= process_callback
;
57 result
= func(client
, interposed_process_callback
, arg
);