aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-09-29 19:22:24 -0400
committerDavid Robillard <d@drobilla.net>2024-10-12 11:10:39 -0400
commit18d6eb5850c7c34d5b6b05034b7392115931684d (patch)
tree89e01a705d3ffb1c915b7a53ebcee7d09eefc2a0
parentb5c4fa663e02fa0a04e7bfa04c86ba5a2206ceec (diff)
downloadjalv-18d6eb5850c7c34d5b6b05034b7392115931684d.tar.gz
jalv-18d6eb5850c7c34d5b6b05034b7392115931684d.tar.bz2
jalv-18d6eb5850c7c34d5b6b05034b7392115931684d.zip
Clean up portaudio driver
-rw-r--r--src/portaudio.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/portaudio.c b/src/portaudio.c
index bfc1e2d..6088773 100644
--- a/src/portaudio.c
+++ b/src/portaudio.c
@@ -2,13 +2,18 @@
// SPDX-License-Identifier: ISC
#include "backend.h"
-
#include "jalv_internal.h"
+#include "log.h"
+#include "lv2_evbuf.h"
#include "port.h"
-#include "worker.h"
+#include "types.h"
+
+#include "lilv/lilv.h"
+#include "lv2/atom/atom.h"
-#include <math.h>
#include <portaudio.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -24,6 +29,9 @@ pa_process_cb(const void* inputs,
PaStreamCallbackFlags flags,
void* handle)
{
+ (void)time;
+ (void)flags;
+
Jalv* jalv = (Jalv*)handle;
// Prepare port buffers
@@ -69,8 +77,11 @@ pa_process_cb(const void* inputs,
lv2_evbuf_is_valid(i);
i = lv2_evbuf_next(i)) {
// Get event from LV2 buffer
- uint32_t frames, subframes, type, size;
- void* body;
+ uint32_t frames = 0U;
+ uint32_t subframes = 0U;
+ uint32_t type = 0U;
+ uint32_t size = 0U;
+ void* body = NULL;
lv2_evbuf_get(i, &frames, &subframes, &type, &size, &body);
if (jalv->has_ui) {
@@ -112,7 +123,9 @@ jalv_backend_init(Jalv* jalv)
outputParameters.device = Pa_GetDefaultOutputDevice();
if (inputParameters.device == paNoDevice) {
return pa_error("No default input device", paDeviceUnavailable);
- } else if (outputParameters.device == paNoDevice) {
+ }
+
+ if (outputParameters.device == paNoDevice) {
return pa_error("No default output device", paDeviceUnavailable);
}