Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/cubeb_jack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,15 @@ cbjack_process(jack_nframes_t nframes, void * arg)

for (int j = 0; j < MAX_STREAMS; j++) {
cubeb_stream * stm = &ctx->streams[j];
float * bufs_out[stm->out_params.channels];
float * bufs_in[stm->in_params.channels];

if (!stm->in_use)
continue;

float * bufs_out[MAX_CHANNELS] = {};
float * bufs_in[MAX_CHANNELS] = {};
XASSERT(stm->out_params.channels <= MAX_CHANNELS);
XASSERT(stm->in_params.channels <= MAX_CHANNELS);

// handle xruns by skipping audio that should have been played
stm->position += t_jack_xruns * ctx->fragment_size * stm->ratio;

Expand Down Expand Up @@ -851,6 +854,14 @@ cbjack_stream_init(cubeb * context, cubeb_stream ** stream,
return CUBEB_ERROR_INVALID_FORMAT;
}

if ((output_stream_params &&
(output_stream_params->channels < 1 ||
output_stream_params->channels > MAX_CHANNELS)) ||
(input_stream_params && (input_stream_params->channels < 1 ||
input_stream_params->channels > MAX_CHANNELS))) {
return CUBEB_ERROR_INVALID_FORMAT;
}

if ((input_device && input_device != JACK_DEFAULT_IN) ||
(output_device && output_device != JACK_DEFAULT_OUT)) {
return CUBEB_ERROR_NOT_SUPPORTED;
Expand Down
Loading