Clang Format
This commit is contained in:
+1
-1
@@ -99,7 +99,7 @@ void going_inactive(int block) {
|
||||
if (dbus_service_is_running())
|
||||
shairport_sync_set_disable_standby(SHAIRPORT_SYNC(shairportSyncSkeleton), FALSE);
|
||||
#endif
|
||||
config.keep_dac_busy = 0;
|
||||
config.keep_dac_busy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1817,7 +1817,7 @@ int do_open(int do_auto_setup) {
|
||||
}
|
||||
|
||||
int do_close() {
|
||||
debug(2,"alsa: do_close()");
|
||||
debug(2, "alsa: do_close()");
|
||||
if (alsa_backend_state == abm_disconnected)
|
||||
debug(1, "alsa: do_close() -- closing the output device when it is already "
|
||||
"disconnected");
|
||||
|
||||
+7
-8
@@ -242,21 +242,20 @@ static void register_service(AvahiClient *c) {
|
||||
else
|
||||
selected_interface = AVAHI_IF_UNSPEC;
|
||||
if (ap2_text_record_string_list) {
|
||||
ret = avahi_entry_group_add_service_strlst(group, selected_interface, AVAHI_PROTO_UNSPEC, 0,
|
||||
ret = avahi_entry_group_add_service_strlst(group, selected_interface, AVAHI_PROTO_UNSPEC, 0,
|
||||
ap2_service_name, config.regtype2, NULL, NULL,
|
||||
port, ap2_text_record_string_list);
|
||||
if (ret == AVAHI_ERR_COLLISION) {
|
||||
die("Error: AirPlay 2 name \"%s\" is already in use.", ap2_service_name);
|
||||
}
|
||||
|
||||
if (ret == AVAHI_ERR_COLLISION) {
|
||||
die("Error: AirPlay 2 name \"%s\" is already in use.", ap2_service_name);
|
||||
}
|
||||
}
|
||||
if ((ret == 0) && (text_record_string_list)) {
|
||||
ret = avahi_entry_group_add_service_strlst(group, selected_interface, AVAHI_PROTO_UNSPEC, 0,
|
||||
service_name, config.regtype, NULL, NULL, port,
|
||||
text_record_string_list);
|
||||
if (ret == AVAHI_ERR_COLLISION) {
|
||||
die("Error: AirPlay 1 name \"%s\" is already in use.", service_name);
|
||||
}
|
||||
if (ret == AVAHI_ERR_COLLISION) {
|
||||
die("Error: AirPlay 1 name \"%s\" is already in use.", service_name);
|
||||
}
|
||||
}
|
||||
if (ret == 0) {
|
||||
ret = avahi_entry_group_commit(group);
|
||||
|
||||
@@ -96,17 +96,17 @@ void on_connect(struct mosquitto *mosq, __attribute__((unused)) void *userdata,
|
||||
void mqtt_publish(char *topic, char *data_in, uint32_t length_in) {
|
||||
char *data = data_in;
|
||||
uint32_t length = length_in;
|
||||
|
||||
|
||||
if ((length == 0) && (config.mqtt_empty_payload_substitute != NULL)) {
|
||||
length = strlen(config.mqtt_empty_payload_substitute);
|
||||
data = config.mqtt_empty_payload_substitute;
|
||||
}
|
||||
|
||||
|
||||
char fulltopic[strlen(config.mqtt_topic) + strlen(topic) + 3];
|
||||
snprintf(fulltopic, strlen(config.mqtt_topic) + strlen(topic) + 2, "%s/%s", config.mqtt_topic,
|
||||
topic);
|
||||
debug(2, "[MQTT]: publishing under %s", fulltopic);
|
||||
|
||||
|
||||
int rc;
|
||||
if ((rc = mosquitto_publish(global_mosq, NULL, fulltopic, length, data, 0, 0)) !=
|
||||
MOSQ_ERR_SUCCESS) {
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
// (In future version of NQPTP the SMI interface may also be deleted at this point.)
|
||||
// SMI interfaces are not currently deleted or garbage collected.
|
||||
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
@@ -1900,7 +1900,7 @@ void *player_thread_func(void *arg) {
|
||||
int32_t minimum_buffer_occupancy = INT32_MAX;
|
||||
int32_t maximum_buffer_occupancy = INT32_MIN;
|
||||
|
||||
#ifdef CONFIG_AIRPLAY_2
|
||||
#ifdef CONFIG_AIRPLAY_2
|
||||
conn->ap2_audio_buffer_minimum_size = -1;
|
||||
#endif
|
||||
|
||||
@@ -2436,11 +2436,13 @@ void *player_thread_func(void *arg) {
|
||||
statistics_item("min DAC queue", "%*" PRIu64 "", 13, minimum_dac_queue_size);
|
||||
statistics_item("min buffers", "%*" PRIu32 "", 11, minimum_buffer_occupancy);
|
||||
statistics_item("max buffers", "%*" PRIu32 "", 11, maximum_buffer_occupancy);
|
||||
#ifdef CONFIG_AIRPLAY_2
|
||||
if ( conn->ap2_audio_buffer_minimum_size > 10 * 1024)
|
||||
statistics_item("min buffer size", "%*" PRIu32 "k", 14, conn->ap2_audio_buffer_minimum_size/1024);
|
||||
#ifdef CONFIG_AIRPLAY_2
|
||||
if (conn->ap2_audio_buffer_minimum_size > 10 * 1024)
|
||||
statistics_item("min buffer size", "%*" PRIu32 "k", 14,
|
||||
conn->ap2_audio_buffer_minimum_size / 1024);
|
||||
else
|
||||
statistics_item("min buffer size", "%*" PRIu32 "", 15, conn->ap2_audio_buffer_minimum_size);
|
||||
statistics_item("min buffer size", "%*" PRIu32 "", 15,
|
||||
conn->ap2_audio_buffer_minimum_size);
|
||||
#endif
|
||||
statistics_item("nominal fps", "%*.2f", 11, conn->remote_frame_rate);
|
||||
statistics_item("received fps", "%*.2f", 12, conn->input_frame_rate);
|
||||
@@ -2476,7 +2478,7 @@ void *player_thread_func(void *arg) {
|
||||
minimum_dac_queue_size = UINT64_MAX; // hack reset
|
||||
maximum_buffer_occupancy = INT32_MIN; // can't be less than this
|
||||
minimum_buffer_occupancy = INT32_MAX; // can't be more than this
|
||||
#ifdef CONFIG_AIRPLAY_2
|
||||
#ifdef CONFIG_AIRPLAY_2
|
||||
conn->ap2_audio_buffer_minimum_size = -1;
|
||||
#endif
|
||||
at_least_one_frame_seen = 0;
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ int ptp_shm_interface_open() {
|
||||
debug(3, "ptp_shm_interface_open is NULL");
|
||||
if (mapped_addr == MAP_FAILED)
|
||||
debug(3, "ptp_shm_interface_open is MAP_FAILED");
|
||||
|
||||
|
||||
if (strcmp(config.nqptp_shared_memory_interface_name, "") != 0) {
|
||||
response = 0;
|
||||
int shared_memory_file_descriptor =
|
||||
|
||||
@@ -80,63 +80,63 @@ typedef struct {
|
||||
|
||||
void check64conversion(const char *prompt, const uint8_t *source, uint64_t value) {
|
||||
char converted_value[128];
|
||||
sprintf(converted_value,"%" PRIx64 "", value);
|
||||
|
||||
sprintf(converted_value, "%" PRIx64 "", value);
|
||||
|
||||
char obf[32];
|
||||
char *obfp = obf;
|
||||
int obfc;
|
||||
int suppress_zeroes = 1;
|
||||
for (obfc=0;obfc<8;obfc++) {
|
||||
if ((suppress_zeroes == 0) || (source[obfc] != 0)){
|
||||
for (obfc = 0; obfc < 8; obfc++) {
|
||||
if ((suppress_zeroes == 0) || (source[obfc] != 0)) {
|
||||
if (suppress_zeroes != 0) {
|
||||
if (source[obfc] < 0x10) {
|
||||
snprintf(obfp, 3, "%1x", source[obfc]);
|
||||
obfp+=1;
|
||||
obfp += 1;
|
||||
} else {
|
||||
snprintf(obfp, 3, "%02x", source[obfc]);
|
||||
obfp+=2;
|
||||
snprintf(obfp, 3, "%02x", source[obfc]);
|
||||
obfp += 2;
|
||||
}
|
||||
} else {
|
||||
snprintf(obfp, 3, "%02x", source[obfc]);
|
||||
obfp+=2;
|
||||
obfp += 2;
|
||||
}
|
||||
suppress_zeroes = 0;
|
||||
}
|
||||
};
|
||||
*obfp=0;
|
||||
if (strcmp(converted_value,obf) != 0) {
|
||||
debug(1,"%s check64conversion error converting \"%s\" to %" PRIx64 ".", prompt, obf, value);
|
||||
*obfp = 0;
|
||||
if (strcmp(converted_value, obf) != 0) {
|
||||
debug(1, "%s check64conversion error converting \"%s\" to %" PRIx64 ".", prompt, obf, value);
|
||||
}
|
||||
}
|
||||
|
||||
void check32conversion(const char *prompt, const uint8_t *source, uint32_t value) {
|
||||
char converted_value[128];
|
||||
sprintf(converted_value,"%" PRIx32 "", value);
|
||||
|
||||
sprintf(converted_value, "%" PRIx32 "", value);
|
||||
|
||||
char obf[32];
|
||||
char *obfp = obf;
|
||||
int obfc;
|
||||
int suppress_zeroes = 1;
|
||||
for (obfc=0;obfc<4;obfc++) {
|
||||
if ((suppress_zeroes == 0) || (source[obfc] != 0)){
|
||||
for (obfc = 0; obfc < 4; obfc++) {
|
||||
if ((suppress_zeroes == 0) || (source[obfc] != 0)) {
|
||||
if (suppress_zeroes != 0) {
|
||||
if (source[obfc] < 0x10) {
|
||||
snprintf(obfp, 3, "%1x", source[obfc]);
|
||||
obfp+=1;
|
||||
obfp += 1;
|
||||
} else {
|
||||
snprintf(obfp, 3, "%02x", source[obfc]);
|
||||
obfp+=2;
|
||||
snprintf(obfp, 3, "%02x", source[obfc]);
|
||||
obfp += 2;
|
||||
}
|
||||
} else {
|
||||
snprintf(obfp, 3, "%02x", source[obfc]);
|
||||
obfp+=2;
|
||||
obfp += 2;
|
||||
}
|
||||
suppress_zeroes = 0;
|
||||
}
|
||||
};
|
||||
*obfp=0;
|
||||
if (strcmp(converted_value,obf) != 0) {
|
||||
debug(1,"%s check32conversion error converting \"%s\" to %" PRIx32 ".", prompt, obf, value);
|
||||
*obfp = 0;
|
||||
if (strcmp(converted_value, obf) != 0) {
|
||||
debug(1, "%s check32conversion error converting \"%s\" to %" PRIx32 ".", prompt, obf, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1790,7 +1790,7 @@ void *rtp_ap2_control_receiver(void *arg) {
|
||||
// add in the audio_backend_latency_offset;
|
||||
int32_t notified_latency = frame_2 - frame_1;
|
||||
if (notified_latency != 77175)
|
||||
debug(1,"Notified latency is %d frames.", notified_latency);
|
||||
debug(1, "Notified latency is %d frames.", notified_latency);
|
||||
int32_t added_latency =
|
||||
(int32_t)(config.audio_backend_latency_offset * conn->input_rate);
|
||||
// the actual latency is the notified latency plus the fixed latency + the added latency
|
||||
@@ -1804,8 +1804,14 @@ void *rtp_ap2_control_receiver(void *arg) {
|
||||
|
||||
if (net_latency <= 0) {
|
||||
if (conn->latency_warning_issued == 0) {
|
||||
warn("The stream latency (%f seconds) it too short to accommodate an offset of %f seconds and a backend buffer of %f seconds.", ((notified_latency + 11035) * 1.0)/conn->input_rate, config.audio_backend_latency_offset, config.audio_backend_buffer_desired_length);
|
||||
warn("(FYI the stream latency needed would be %f seconds.)", config.audio_backend_buffer_desired_length - config.audio_backend_latency_offset);
|
||||
warn("The stream latency (%f seconds) it too short to accommodate an offset of %f "
|
||||
"seconds and a backend buffer of %f seconds.",
|
||||
((notified_latency + 11035) * 1.0) / conn->input_rate,
|
||||
config.audio_backend_latency_offset,
|
||||
config.audio_backend_buffer_desired_length);
|
||||
warn("(FYI the stream latency needed would be %f seconds.)",
|
||||
config.audio_backend_buffer_desired_length -
|
||||
config.audio_backend_latency_offset);
|
||||
conn->latency_warning_issued = 1;
|
||||
}
|
||||
conn->latency = notified_latency + 11035;
|
||||
@@ -1926,7 +1932,8 @@ void *rtp_realtime_audio_receiver(void *arg) {
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
ssize_t buffered_read(buffered_tcp_desc *descriptor, void *buf, size_t count, size_t *bytes_remaining) {
|
||||
ssize_t buffered_read(buffered_tcp_desc *descriptor, void *buf, size_t count,
|
||||
size_t *bytes_remaining) {
|
||||
ssize_t response = -1;
|
||||
if (pthread_mutex_lock(&descriptor->mutex) != 0)
|
||||
debug(1, "problem with mutex");
|
||||
@@ -1937,7 +1944,7 @@ ssize_t buffered_read(buffered_tcp_desc *descriptor, void *buf, size_t count, si
|
||||
debug(2, "buffered_read: waiting for %u bytes (okay at start of a track).", count);
|
||||
else
|
||||
debug(1, "buffered_read: waiting for %u bytes.", count);
|
||||
}
|
||||
}
|
||||
while ((descriptor->buffer_occupancy == 0) && (descriptor->error_code == 0)) {
|
||||
if (pthread_cond_wait(&descriptor->not_empty_cv, &descriptor->mutex))
|
||||
debug(1, "Error waiting for buffered read");
|
||||
@@ -2035,7 +2042,8 @@ void *buffered_tcp_reader(void *arg) {
|
||||
if (nread < 0) {
|
||||
char errorstring[1024];
|
||||
strerror_r(errno, (char *)errorstring, sizeof(errorstring));
|
||||
debug(1, "error in buffered_tcp_reader %d: \"%s\". Could not recv a packet.", errno, errorstring);
|
||||
debug(1, "error in buffered_tcp_reader %d: \"%s\". Could not recv a packet.", errno,
|
||||
errorstring);
|
||||
descriptor->error_code = errno;
|
||||
} else if (nread == 0) {
|
||||
descriptor->closed = 1;
|
||||
@@ -2090,7 +2098,8 @@ void av_packet_alloc_cleanup_handler(void *arg) {
|
||||
|
||||
// this will read a block of the size specified to the buffer
|
||||
// and will return either with the block or on error
|
||||
ssize_t lread_sized_block(buffered_tcp_desc *descriptor, void *buf, size_t count, size_t *bytes_remaining) {
|
||||
ssize_t lread_sized_block(buffered_tcp_desc *descriptor, void *buf, size_t count,
|
||||
size_t *bytes_remaining) {
|
||||
ssize_t response, nread;
|
||||
size_t inbuf = 0; // bytes already in the buffer
|
||||
int keep_trying = 1;
|
||||
@@ -2596,8 +2605,10 @@ void *rtp_buffered_audio_processor(void *arg) {
|
||||
uint16_t data_len;
|
||||
// here we read from the buffer that our thread has been reading
|
||||
size_t bytes_remaining_in_buffer;
|
||||
nread = lread_sized_block(buffered_audio, &data_len, sizeof(data_len), &bytes_remaining_in_buffer);
|
||||
if ((conn->ap2_audio_buffer_minimum_size < 0) || (bytes_remaining_in_buffer < (size_t)conn->ap2_audio_buffer_minimum_size))
|
||||
nread = lread_sized_block(buffered_audio, &data_len, sizeof(data_len),
|
||||
&bytes_remaining_in_buffer);
|
||||
if ((conn->ap2_audio_buffer_minimum_size < 0) ||
|
||||
(bytes_remaining_in_buffer < (size_t)conn->ap2_audio_buffer_minimum_size))
|
||||
conn->ap2_audio_buffer_minimum_size = bytes_remaining_in_buffer;
|
||||
if (nread < 0) {
|
||||
char errorstring[1024];
|
||||
@@ -2610,7 +2621,8 @@ void *rtp_buffered_audio_processor(void *arg) {
|
||||
data_len = ntohs(data_len);
|
||||
// debug(1,"buffered audio packet of size %u detected.", data_len - 2);
|
||||
nread = lread_sized_block(buffered_audio, packet, data_len - 2, &bytes_remaining_in_buffer);
|
||||
if ((conn->ap2_audio_buffer_minimum_size < 0) || (bytes_remaining_in_buffer < (size_t)conn->ap2_audio_buffer_minimum_size))
|
||||
if ((conn->ap2_audio_buffer_minimum_size < 0) ||
|
||||
(bytes_remaining_in_buffer < (size_t)conn->ap2_audio_buffer_minimum_size))
|
||||
conn->ap2_audio_buffer_minimum_size = bytes_remaining_in_buffer;
|
||||
// debug(1, "buffered audio packet of size %u received.", nread);
|
||||
if (nread < 0) {
|
||||
@@ -2647,11 +2659,12 @@ void *rtp_buffered_audio_processor(void *arg) {
|
||||
int64_t local_lead_time = 0;
|
||||
int64_t requested_lead_time_ns = (int64_t)(requested_lead_time * 1000000000);
|
||||
// requested_lead_time_ns = (int64_t)(-300000000);
|
||||
// debug(1,"requested_lead_time_ns is actually %f milliseconds.", requested_lead_time_ns * 1E-6);
|
||||
// debug(1,"requested_lead_time_ns is actually %f milliseconds.", requested_lead_time_ns *
|
||||
// 1E-6);
|
||||
int outdated = 0;
|
||||
if (have_time_information == 0) {
|
||||
local_lead_time = local_should_be_time - get_absolute_time_in_ns();
|
||||
// debug(1,"local_lead_time is actually %f milliseconds.", local_lead_time * 1E-6);
|
||||
// debug(1,"local_lead_time is actually %f milliseconds.", local_lead_time * 1E-6);
|
||||
outdated = (local_lead_time < requested_lead_time_ns);
|
||||
// if (outdated != 0)
|
||||
// debug(1,"Frame is outdated %d if lead_time %" PRId64 " is less than requested lead time
|
||||
|
||||
@@ -1827,7 +1827,8 @@ void handle_setrateanchori(rtsp_conn_info *conn, rtsp_message *req, rtsp_message
|
||||
uint32_t anchorRTPTime = rtpTime;
|
||||
|
||||
int32_t added_latency = (int32_t)(config.audio_backend_latency_offset * conn->input_rate);
|
||||
// debug(1,"anchorRTPTime: %" PRIu32 ", added latency: %" PRId32 ".", anchorRTPTime, added_latency);
|
||||
// debug(1,"anchorRTPTime: %" PRIu32 ", added latency: %" PRId32 ".", anchorRTPTime,
|
||||
// added_latency);
|
||||
set_ptp_anchor_info(conn, conn->networkTimeTimelineID, anchorRTPTime - added_latency,
|
||||
anchorTimeNanoseconds);
|
||||
}
|
||||
@@ -1878,8 +1879,7 @@ void handle_get(__attribute((unused)) rtsp_conn_info *conn, __attribute((unused)
|
||||
resp->respcode = 500;
|
||||
}
|
||||
|
||||
void handle_post(rtsp_conn_info *conn,
|
||||
rtsp_message *req,
|
||||
void handle_post(rtsp_conn_info *conn, rtsp_message *req,
|
||||
__attribute((unused)) rtsp_message *resp) {
|
||||
debug(1, "Connection %d: POST %s Content-Length %d", conn->connection_number, req->path,
|
||||
req->contentlength);
|
||||
@@ -2344,15 +2344,13 @@ void handle_command(__attribute__((unused)) rtsp_conn_info *conn, rtsp_message *
|
||||
}
|
||||
}
|
||||
|
||||
void handle_audio_mode(rtsp_conn_info *conn,
|
||||
rtsp_message *req,
|
||||
__attribute__((unused)) rtsp_message *resp) {
|
||||
void handle_audio_mode(rtsp_conn_info *conn, rtsp_message *req,
|
||||
__attribute__((unused)) rtsp_message *resp) {
|
||||
debug(2, "Connection %d: POST %s Content-Length %d", conn->connection_number, req->path,
|
||||
req->contentlength);
|
||||
debug_log_rtsp_message(2, NULL, req);
|
||||
}
|
||||
|
||||
|
||||
void handle_post(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) {
|
||||
resp->respcode = 200;
|
||||
if (strcmp(req->path, "/pair-setup") == 0) {
|
||||
@@ -2695,9 +2693,10 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
|
||||
// if it's a full service PTP stream, we get groupUUID, groupContainsGroupLeader and
|
||||
// timingPeerList
|
||||
if (conn->airplay_stream_category == ptp_stream) {
|
||||
if (ptp_shm_interface_open() != 0) // it should be open already, but just in case it isn't...
|
||||
if (ptp_shm_interface_open() !=
|
||||
0) // it should be open already, but just in case it isn't...
|
||||
die("Can not access the NQPTP service. Has it stopped running?");
|
||||
ptp_send_control_message_string("T"); // remove all previous history
|
||||
ptp_send_control_message_string("T"); // remove all previous history
|
||||
debug_log_rtsp_message(2, "SETUP \"PTP\" message", req);
|
||||
plist_t groupUUID = plist_dict_get_item(messagePlist, "groupUUID");
|
||||
if (groupUUID) {
|
||||
@@ -4818,14 +4817,13 @@ static void *rtsp_conversation_thread_func(void *pconn) {
|
||||
pthread_cleanup_push(msg_cleanup_function, (void *)&resp);
|
||||
resp->respcode = 501; // Not Implemented
|
||||
int dl = debug_level;
|
||||
if ((strcmp(req->method, "OPTIONS") ==
|
||||
0) || (strcmp(req->method, "POST") ==
|
||||
0)) // the options message is very common, so don't log it until level 3
|
||||
if ((strcmp(req->method, "OPTIONS") == 0) ||
|
||||
(strcmp(req->method, "POST") ==
|
||||
0)) // the options message is very common, so don't log it until level 3
|
||||
dl = 3;
|
||||
debug(dl,
|
||||
"Connection %d: Received an RTSP Packet of type \"%s\":", conn->connection_number,
|
||||
debug(dl, "Connection %d: Received an RTSP Packet of type \"%s\":", conn->connection_number,
|
||||
req->method),
|
||||
debug_print_msg_headers(dl, req);
|
||||
debug_print_msg_headers(dl, req);
|
||||
apple_challenge(conn->fd, req, resp);
|
||||
hdr = msg_get_header(req, "CSeq");
|
||||
if (hdr)
|
||||
|
||||
+40
-22
@@ -44,10 +44,10 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifdef CONFIG_AIRPLAY_2
|
||||
#include "ptp-utilities.h"
|
||||
#include <gcrypt.h>
|
||||
#include <sodium.h>
|
||||
#include <uuid/uuid.h>
|
||||
#include "ptp-utilities.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MBEDTLS
|
||||
@@ -605,7 +605,9 @@ int parse_options(int argc, char **argv) {
|
||||
"support. Change the \"general/interpolation\" setting in the configuration file.");
|
||||
#endif
|
||||
else
|
||||
die("Invalid interpolation option choice \"%s\". It should be \"auto\", \"basic\" or \"soxr\"", str);
|
||||
die("Invalid interpolation option choice \"%s\". It should be \"auto\", \"basic\" or "
|
||||
"\"soxr\"",
|
||||
str);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SOXR
|
||||
@@ -681,7 +683,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.debugger_show_file_and_line = 1;
|
||||
else
|
||||
die("Invalid diagnostics log_show_file_and_line option choice \"%s\". It should be "
|
||||
"\"yes\" or \"no\"", str);
|
||||
"\"yes\" or \"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
/* Get the show elapsed time in debug messages setting. */
|
||||
@@ -692,7 +695,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.debugger_show_elapsed_time = 1;
|
||||
else
|
||||
die("Invalid diagnostics log_show_time_since_startup option choice \"%s\". It should be "
|
||||
"\"yes\" or \"no\"", str);
|
||||
"\"yes\" or \"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
/* Get the show relative time in debug messages setting. */
|
||||
@@ -703,7 +707,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.debugger_show_relative_time = 1;
|
||||
else
|
||||
die("Invalid diagnostics log_show_time_since_last_message option choice \"%s\". It "
|
||||
"should be \"yes\" or \"no\"", str);
|
||||
"should be \"yes\" or \"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
/* Get the statistics setting. */
|
||||
@@ -714,7 +719,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.statistics_requested = 1;
|
||||
else
|
||||
die("Invalid diagnostics statistics option choice \"%s\". It should be \"yes\" or "
|
||||
"\"no\"", str);
|
||||
"\"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
/* Get the disable_resend_requests setting. */
|
||||
@@ -727,7 +733,8 @@ int parse_options(int argc, char **argv) {
|
||||
else
|
||||
die("Invalid diagnostic disable_resend_requests option choice \"%s\". It should be "
|
||||
"\"yes\" "
|
||||
"or \"no\"", str);
|
||||
"or \"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
/* Get the drop packets setting. */
|
||||
@@ -764,7 +771,8 @@ int parse_options(int argc, char **argv) {
|
||||
else if (strcasecmp(str, "yes") == 0)
|
||||
config.ignore_volume_control = 1;
|
||||
else
|
||||
die("Invalid ignore_volume_control option choice \"%s\". It should be \"yes\" or \"no\"", str);
|
||||
die("Invalid ignore_volume_control option choice \"%s\". It should be \"yes\" or \"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
/* Get the optional volume_max_db setting. */
|
||||
@@ -792,7 +800,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.playback_mode = ST_right_only;
|
||||
else
|
||||
die("Invalid playback_mode choice \"%s\". It should be \"stereo\" (default), \"mono\", "
|
||||
"\"reverse stereo\", \"both left\", \"both right\"", str);
|
||||
"\"reverse stereo\", \"both left\", \"both right\"",
|
||||
str);
|
||||
}
|
||||
|
||||
/* Get the volume control profile setting -- "standard" or "flat" */
|
||||
@@ -803,7 +812,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.volume_control_profile = VCP_flat;
|
||||
else
|
||||
die("Invalid volume_control_profile choice \"%s\". It should be \"standard\" (default) "
|
||||
"or \"flat\"", str);
|
||||
"or \"flat\"",
|
||||
str);
|
||||
}
|
||||
|
||||
config_set_lookup_bool(config.cfg, "general.volume_control_combined_hardware_priority",
|
||||
@@ -855,7 +865,8 @@ int parse_options(int argc, char **argv) {
|
||||
inform("Support for the Apple ALAC decoder has not been compiled into this version of "
|
||||
"Shairport Sync. The default decoder will be used.");
|
||||
} else
|
||||
die("Invalid alac_decoder option choice \"%s\". It should be \"hammerton\" or \"apple\"", str);
|
||||
die("Invalid alac_decoder option choice \"%s\". It should be \"hammerton\" or \"apple\"",
|
||||
str);
|
||||
}
|
||||
|
||||
/* Get the resend control settings. */
|
||||
@@ -926,7 +937,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.get_coverart = 1;
|
||||
else
|
||||
die("Invalid metadata include_cover_art option choice \"%s\". It should be \"yes\" or "
|
||||
"\"no\"", str);
|
||||
"\"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
if (config_lookup_string(config.cfg, "metadata.pipe_name", &str)) {
|
||||
@@ -958,7 +970,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.retain_coverart = 1;
|
||||
else
|
||||
die("Invalid metadata \"retain_cover_art\" option choice \"%s\". It should be \"yes\" or "
|
||||
"\"no\"", str);
|
||||
"\"no\"",
|
||||
str);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1001,7 +1014,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.cmd_blocking = 1;
|
||||
else
|
||||
warn("Invalid \"wait_for_completion\" option choice \"%s\". It should be "
|
||||
"\"yes\" or \"no\". It is set to \"no\".", str);
|
||||
"\"yes\" or \"no\". It is set to \"no\".",
|
||||
str);
|
||||
}
|
||||
|
||||
if (config_lookup_string(config.cfg, "sessioncontrol.before_play_begins_returns_output",
|
||||
@@ -1013,7 +1027,8 @@ int parse_options(int argc, char **argv) {
|
||||
else
|
||||
die("Invalid \"before_play_begins_returns_output\" option choice \"%s\". It "
|
||||
"should be "
|
||||
"\"yes\" or \"no\"", str);
|
||||
"\"yes\" or \"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
if (config_lookup_string(config.cfg, "sessioncontrol.allow_session_interruption", &str)) {
|
||||
@@ -1025,7 +1040,8 @@ int parse_options(int argc, char **argv) {
|
||||
else
|
||||
die("Invalid \"allow_interruption\" option choice \"%s\". It should be "
|
||||
"\"yes\" "
|
||||
"or \"no\"", str);
|
||||
"or \"no\"",
|
||||
str);
|
||||
}
|
||||
|
||||
if (config_lookup_int(config.cfg, "sessioncontrol.session_timeout", &value)) {
|
||||
@@ -1106,7 +1122,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.dbus_service_bus_type = DBT_session;
|
||||
else
|
||||
die("Invalid dbus_service_bus option choice \"%s\". It should be \"system\" (default) or "
|
||||
"\"session\"", str);
|
||||
"\"session\"",
|
||||
str);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1119,7 +1136,8 @@ int parse_options(int argc, char **argv) {
|
||||
config.mpris_service_bus_type = DBT_session;
|
||||
else
|
||||
die("Invalid mpris_service_bus option choice \"%s\". It should be \"system\" (default) or "
|
||||
"\"session\"", str);
|
||||
"\"session\"",
|
||||
str);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2218,16 +2236,16 @@ int main(int argc, char **argv) {
|
||||
do {
|
||||
ptp_send_control_message_string("T"); // get nqptp to create the named shm interface
|
||||
usleep(ptp_wait_interval_us);
|
||||
ptp_check_times++;
|
||||
ptp_check_times++;
|
||||
} while ((ptp_shm_interface_open() != 0) && (ptp_check_times < (2000000 / ptp_wait_interval_us)));
|
||||
|
||||
|
||||
if (ptp_shm_interface_open() != 0) {
|
||||
die("Can't access NQPTP! Is it installed and running?");
|
||||
} else {
|
||||
if (ptp_check_times == 1)
|
||||
debug(1,"NQPTP is online.");
|
||||
debug(1, "NQPTP is online.");
|
||||
else
|
||||
debug(1,"NQPTP is online after %u microseconds.",ptp_check_times * ptp_wait_interval_us);
|
||||
debug(1, "NQPTP is online after %u microseconds.", ptp_check_times * ptp_wait_interval_us);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user