summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Linden <karl.j.linden@gmail.com>2018-10-06 13:15:11 +0200
committerKarl Linden <karl.j.linden@gmail.com>2018-10-06 13:15:11 +0200
commitf5f22c6befc1b4bc5807de00496c087125f92adf (patch)
treebc1f83863dc49e304a06b33f5eafa02e2cb7d6ad
parentdde9f29a8ef94c72f83a1e4881158dc537d24fce (diff)
downloadjack2-f5f22c6befc1b4bc5807de00496c087125f92adf.tar.gz
Revert "Fix unused{,-but-set}-variable compiler warnings."
This reverts commit dde9f29a8ef94c72f83a1e4881158dc537d24fce. The commit introduced the following compiler error: [100/255] Compiling posix/JackNetUnixSocket.cpp ../posix/JackNetUnixSocket.cpp: In member function 'int Jack::JackNetUnixSocket::NewSocket()': ../posix/JackNetUnixSocket.cpp:126:32: error: 'tos' was not declared in this scope socklen_t len = sizeof(tos);
-rw-r--r--common/JackNetOneDriver.cpp12
-rw-r--r--example-clients/metro.c5
-rw-r--r--example-clients/midiseq.c2
-rw-r--r--linux/alsa/alsa_driver.c27
-rw-r--r--linux/alsa/alsa_seqmidi.c3
-rw-r--r--linux/alsa/hdsp.c3
-rw-r--r--posix/JackNetUnixSocket.cpp2
-rw-r--r--tests/cpu.c3
-rw-r--r--tests/test.cpp2
9 files changed, 44 insertions, 15 deletions
diff --git a/common/JackNetOneDriver.cpp b/common/JackNetOneDriver.cpp
index 572d3a21..90731c20 100644
--- a/common/JackNetOneDriver.cpp
+++ b/common/JackNetOneDriver.cpp
@@ -986,6 +986,9 @@ extern "C"
unsigned int latency = 5;
unsigned int redundancy = 1;
unsigned int mtu = 1400;
+#if HAVE_SAMPLERATE
+ unsigned int resample_factor_up = 1;
+#endif
int dont_htonl_floats = 0;
int always_deadline = 0;
int jitter_val = 0;
@@ -1032,6 +1035,15 @@ extern "C"
#endif
break;
+ case 'u':
+#if HAVE_SAMPLERATE
+ resample_factor_up = param->value.ui;
+#else
+ jack_error("not built with libsamplerate support");
+ return NULL;
+#endif
+ break;
+
case 'b':
bitdepth = param->value.ui;
break;
diff --git a/example-clients/metro.c b/example-clients/metro.c
index 065d03e4..8240b40c 100644
--- a/example-clients/metro.c
+++ b/example-clients/metro.c
@@ -135,6 +135,7 @@ main (int argc, char *argv[])
int attack_percent = 1, decay_percent = 10, dur_arg = 100;
char *client_name = 0;
char *bpm_string = "bpm";
+ int verbose = 0;
jack_status_t status;
const char *options = "f:A:D:a:d:b:n:thv";
@@ -149,6 +150,7 @@ main (int argc, char *argv[])
{"name", 1, 0, 'n'},
{"transport", 0, 0, 't'},
{"help", 0, 0, 'h'},
+ {"verbose", 0, 0, 'v'},
{0, 0, 0, 0}
};
@@ -196,6 +198,9 @@ main (int argc, char *argv[])
client_name = (char *) malloc ((strlen (optarg) + 1) * sizeof (char));
strcpy (client_name, optarg);
break;
+ case 'v':
+ verbose = 1;
+ break;
case 't':
transport_aware = 1;
break;
diff --git a/example-clients/midiseq.c b/example-clients/midiseq.c
index 867942f5..45085e80 100644
--- a/example-clients/midiseq.c
+++ b/example-clients/midiseq.c
@@ -82,6 +82,7 @@ static int process(jack_nframes_t nframes, void *arg)
int main(int narg, char **args)
{
int i;
+ jack_nframes_t nframes;
if ((narg<6) || ((narg-3)%3 != 0)) {
usage();
exit(1);
@@ -92,6 +93,7 @@ int main(int narg, char **args)
}
jack_set_process_callback (client, process, 0);
output_port = jack_port_register (client, "out", JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0);
+ nframes = jack_get_buffer_size(client);
loop_index = 0;
num_notes = (narg - 3)/3;
note_frqs = malloc(num_notes*sizeof(unsigned char));
diff --git a/linux/alsa/alsa_driver.c b/linux/alsa/alsa_driver.c
index ba17079a..be4fa849 100644
--- a/linux/alsa/alsa_driver.c
+++ b/linux/alsa/alsa_driver.c
@@ -625,6 +625,7 @@ alsa_driver_set_parameters (alsa_driver_t *driver,
channel_t chn;
unsigned int pr = 0;
unsigned int cr = 0;
+ int err;
driver->frame_rate = rate;
driver->frames_per_cycle = frames_per_cycle;
@@ -716,14 +717,14 @@ alsa_driver_set_parameters (alsa_driver_t *driver,
if (driver->playback_handle) {
snd_pcm_access_t access;
- snd_pcm_hw_params_get_period_size (
- driver->playback_hw_params, &p_period_size, &dir);
- snd_pcm_hw_params_get_format (
- driver->playback_hw_params,
- &(driver->playback_sample_format))
- snd_pcm_hw_params_get_access (driver->playback_hw_params,
+ err = snd_pcm_hw_params_get_period_size (
+ driver->playback_hw_params, &p_period_size, &dir);
+ err = snd_pcm_hw_params_get_format (
+ driver->playback_hw_params,
+ &(driver->playback_sample_format));
+ err = snd_pcm_hw_params_get_access (driver->playback_hw_params,
&access);
- driver->playback_interleaved =
+ driver->playback_interleaved =
(access == SND_PCM_ACCESS_MMAP_INTERLEAVED)
|| (access == SND_PCM_ACCESS_MMAP_COMPLEX);
@@ -739,14 +740,14 @@ alsa_driver_set_parameters (alsa_driver_t *driver,
if (driver->capture_handle) {
snd_pcm_access_t access;
- snd_pcm_hw_params_get_period_size (
- driver->capture_hw_params, &c_period_size, &dir);
- snd_pcm_hw_params_get_format (
- driver->capture_hw_params,
+ err = snd_pcm_hw_params_get_period_size (
+ driver->capture_hw_params, &c_period_size, &dir);
+ err = snd_pcm_hw_params_get_format (
+ driver->capture_hw_params,
&(driver->capture_sample_format));
- snd_pcm_hw_params_get_access (driver->capture_hw_params,
+ err = snd_pcm_hw_params_get_access (driver->capture_hw_params,
&access);
- driver->capture_interleaved =
+ driver->capture_interleaved =
(access == SND_PCM_ACCESS_MMAP_INTERLEAVED)
|| (access == SND_PCM_ACCESS_MMAP_COMPLEX);
diff --git a/linux/alsa/alsa_seqmidi.c b/linux/alsa/alsa_seqmidi.c
index 49e7e765..f7583f39 100644
--- a/linux/alsa/alsa_seqmidi.c
+++ b/linux/alsa/alsa_seqmidi.c
@@ -856,6 +856,7 @@ void do_jack_output(alsa_seqmidi_t *self, port_t *port, struct process_info* inf
int64_t frame_offset;
int64_t out_time;
snd_seq_real_time_t out_rt;
+ int err;
jack_midi_event_get(&jack_event, port->jack_buf, i);
@@ -895,7 +896,7 @@ void do_jack_output(alsa_seqmidi_t *self, port_t *port, struct process_info* inf
out_rt.tv_sec = out_time / NSEC_PER_SEC;
snd_seq_ev_schedule_real(&alsa_event, self->queue, 0, &out_rt);
- snd_seq_event_output(self->seq, &alsa_event);
+ err = snd_seq_event_output(self->seq, &alsa_event);
debug_log("alsa_out: written %d bytes to %s at %+d (%lld): %d", (int)jack_event.size, port->name, (int)frame_offset, out_time, err);
}
}
diff --git a/linux/alsa/hdsp.c b/linux/alsa/hdsp.c
index 606990e2..64dcb407 100644
--- a/linux/alsa/hdsp.c
+++ b/linux/alsa/hdsp.c
@@ -39,6 +39,9 @@ static const int hdsp_num_input_channels = 52;
static const int hdsp_physical_input_index[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
+static const int hdsp_audio_stream_index[] = {
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51};
/*
* Use this array to choose the value of the output_channel
diff --git a/posix/JackNetUnixSocket.cpp b/posix/JackNetUnixSocket.cpp
index a2e2bbcc..bfbc0a23 100644
--- a/posix/JackNetUnixSocket.cpp
+++ b/posix/JackNetUnixSocket.cpp
@@ -111,6 +111,8 @@ namespace Jack
StrError(NET_ERROR_CODE);
}
+ int tos = 0; /* see <netinet/in.h> */
+
/*
DSCP Field Hex/Bin/Dec Layer 2 Prio Traffic Type Acronym WMM Access Category
0x38 / 111000 / 56 7 Network Control NC AC_VO
diff --git a/tests/cpu.c b/tests/cpu.c
index d3f46231..a3541db2 100644
--- a/tests/cpu.c
+++ b/tests/cpu.c
@@ -78,9 +78,10 @@ int update_buffer_size(jack_nframes_t nframes, void *arg)
int process(jack_nframes_t nframes, void *arg)
{
- jack_default_audio_sample_t *out;
+ jack_default_audio_sample_t *in, *out;
jack_nframes_t start_frame = jack_frame_time(client);
+ in = (jack_default_audio_sample_t *) jack_port_get_buffer (input_port, nframes);
out = (jack_default_audio_sample_t *) jack_port_get_buffer (output_port, nframes);
memset(out, 0, sizeof (jack_default_audio_sample_t) * nframes);
diff --git a/tests/test.cpp b/tests/test.cpp
index 6cd74572..b355ec64 100644
--- a/tests/test.cpp
+++ b/tests/test.cpp
@@ -494,6 +494,8 @@ int process5(jack_nframes_t nframes, void *arg)
static jack_nframes_t first_current_frames;
static jack_time_t first_current_usecs;
static jack_time_t first_next_usecs;
+ static float first_period_usecs;
+ static int res1 = jack_get_cycle_times(client, &first_current_frames, &first_current_usecs, &first_next_usecs, &first_period_usecs);
jack_nframes_t current_frames;
jack_time_t current_usecs;