From 753cc07777abed3f7953720b55458b7e80bf3fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Nettingsmeier?= Date: Fri, 15 Feb 2019 23:39:53 +0000 Subject: [PATCH] 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. --- audio_jack.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/audio_jack.c b/audio_jack.c index b67e16ca..c04853f0 100644 --- a/audio_jack.c +++ b/audio_jack.c @@ -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;