Skip to content

Commit

Permalink
Implement jack buffer-size changes
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Oct 29, 2013
1 parent af044d9 commit 9fd245f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions release/distrib/replay/lib/sounddriver/sounddriver_linux.cpp
Expand Up @@ -61,6 +61,12 @@ void AUDIO_Stop_Sound_Buffer(void) {}
void (STDCALL *AUDIO_Mixer)(Uint8 *, Uint32) = NULL;
void (STDCALL *AUDIO_MixerFloat)(float*, float*, Uint32) = NULL;

static int jaudio_bufsize_callback(jack_nframes_t newBufferSize, void*)
{
AUDIO_Latency = newBufferSize;
return 0;
}

static int jaudio_process_callback(jack_nframes_t nframes, void*)
{
float* audioBuf1 = (float*)jack_port_get_buffer(jaudio_port1, nframes);
Expand Down Expand Up @@ -121,6 +127,7 @@ int _init_JACK()
jaudio_port1 = jack_port_register(jaudio_client, "out1", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
jaudio_port2 = jack_port_register(jaudio_client, "out2", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);

jack_set_buffer_size_callback(jaudio_client, jaudio_bufsize_callback, NULL);
jack_set_process_callback(jaudio_client, jaudio_process_callback, NULL);
jack_on_shutdown(jaudio_client, jaudio_shutdown_callback, NULL);

Expand Down

0 comments on commit 9fd245f

Please sign in to comment.