Remove optional is_running() API call, since it doesn't do anything useful.

We are either already running along just fine, or we are throughly dead.
This commit is contained in:
Jörn Nettingsmeier
2019-02-15 23:39:53 +00:00
parent 1906bfd727
commit 753cc07777
+1 -31
View File
@@ -58,7 +58,7 @@ audio_output audio_jack = {.name = "jack",
.deinit = &jack_deinit,
.start = &jack_start,
.stop = NULL,
.is_running = &jack_is_running,
.is_running = NULL,
.flush = &jack_flush,
.delay = &jack_delay,
.play = &play,
@@ -232,36 +232,6 @@ void jack_start(__attribute__((unused)) int i_sample_rate,
// nothing to do, JACK client has already been set up at jack_init()
}
int jack_is_running() {
int reply = -1; // meaning jack is not running
if (client_is_open) {
// check if the ports have a zero latency -- if they both have, then it's disconnected.
// FIXME: this causes a segfault when shairport-sync is exited with CTRL-C, because
// the client_is_open flag is stale by then. Also, this test is not necessary.
// shairport-sync should not worry what's reading its ports. As long as jack is alive,
// deliver audio, even if nothing is connected. This behaviour probably stems from
// the wish to not hog an audio device if not needed, which is no longer an issue with
// jack. Moreover, don't "conserve" CPU this way, because in a realtime system you want
// deterministic CPU load more than anything else.
// jack_latency_range_t left_latency_range, right_latency_range;
// jack_port_get_latency_range(left_port, JackPlaybackLatency, &left_latency_range);
// jack_port_get_latency_range(right_port, JackPlaybackLatency, &right_latency_range);
// if ((left_latency_range.min == 0) && (left_latency_range.max == 0) &&
// (right_latency_range.min == 0) && (right_latency_range.max == 0)) {
// reply = -2; // meaning Shairport Sync is not connected
// } else {
// FIXME: For now, we assume JACK is always running, as it should.
// Still need to understand why shairport-sync needs this function.
reply = 0; // meaning jack is open and Shairport Sync is connected to it
// }
}
return reply;
}
void jack_flush() {
// debug(1, "Only the consumer can safely flush a lock-free ringbuffer. Asking the process callback to do it...");
flush_please = 1;