buffered_audio->buffer_max_size = conn->ap2_audio_buffer_size;
buffered_audio->buffer = malloc(conn->ap2_audio_buffer_size);
if (buffered_audio->buffer == NULL)
- debug(1, "cannot allocate an audio buffer of %u bytes!", buffered_audio->buffer_max_size);
+ debug(1, "cannot allocate an audio buffer of %lu bytes!", buffered_audio->buffer_max_size);
pthread_cleanup_push(malloc_cleanup, &buffered_audio->buffer);
// pthread_mutex_lock(&conn->buffered_audio_mutex);
nonce,
conn->session_key); // *k
if (response != 0)
- debug(1, "Error decrypting audio packet %u -- packet length %d.", seq_no,
+ debug(1, "Error decrypting audio packet %u -- packet length %ld.", seq_no,
nread);
} else {
debug(2, "No session key, so the audio packet can not be deciphered -- skipped.");
skip_this_block = 1;
debug(2,
"skipping block %u because it is too old. Timestamp "
- "difference: %d, length of block: %u.",
+ "difference: %d, length of block: %lu.",
seq_no, timestamp_difference, get_ssrc_block_length(payload_ssrc));
}
}
uint64_t currentAnchorLocalTime = 0;
if (get_ptp_anchor_local_time_info(conn, ¤tAnchorRTP,
¤tAnchorLocalTime) == clock_ok) {
- debug(3, "anchorRTP: %u, anchorLocalTime: % " PRIu64 ".", currentAnchorRTP,
+ debug(3, "anchorRTP: %u, anchorLocalTime: %" PRIu64 ".", currentAnchorRTP,
currentAnchorLocalTime);
} else {
debug(3, "Clock not okay");
CHANNELS_FROM_ENCODED_FORMAT(current_encoded_output_format) * 1; // one seconds
audio_lmb = malloc(audio_size);
if (audio_lmb == NULL)
- die("Can't allocate %d bytes for pulseaudio buffer.", audio_size);
+ die("Can't allocate %ld bytes for pulseaudio buffer.", audio_size);
audio_toq = audio_eoq = audio_lmb;
audio_umb = audio_lmb + audio_size;
audio_occupancy = 0;
// allocate space for the audio buffer
audio_lmb = malloc(audio_size);
if (audio_lmb == NULL)
- die("Can't allocate %d bytes for PipeWire buffer.", audio_size);
+ die("Can't allocate %ld bytes for PipeWire buffer.", audio_size);
audio_toq = audio_eoq = audio_lmb;
audio_umb = audio_lmb + audio_size;
audio_occupancy = 0;
// input,strlen(input),inbuf,inbufsize);
int rc = mbedtls_base64_decode(NULL, 0, &dlen, (unsigned char *)inbuf, inbufsize);
if (rc && (rc != MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL))
- debug(1, "Error %d getting decode length, result is %d.", rc, dlen);
+ debug(1, "Error %d getting decode length, result is %ld.", rc, dlen);
else {
// debug(1,"Decode size is %d.",dlen);
buf = malloc(dlen);
t = realloc(ptr, size);
}
if (t == NULL)
- debug(1, "response_realloc of size %d to ptr %" PRIxPTR " failed!", size, ptr);
+ debug(1, "response_realloc of size %d to ptr %" PRIxPTR " failed!", size, (uintptr_t) ptr);
}
return t;
}
int32_t active_speakers = 0;
for (i = 0; i < speaker_count; i++) {
if (speaker_info[i].speaker_number == machine_number) {
- debug(2, "Our speaker number found: %ld with relative volume.", machine_number,
+ debug(2, "Our speaker number found: %ld with relative volume %" PRId32 ".", machine_number,
speaker_info[i].volume);
}
if (speaker_info[i].active == 1) {
if (ret < 0) {
av_frame_free(&decoded_frame);
decoded_frame = NULL;
- debug(1, "error %d during decoding. Data size: %d", ret, incoming_data_length);
+ debug(1, "error %d during decoding. Data size: %ld", ret, incoming_data_length);
/*
char *obf = malloc(incoming_data_length * 3);
char *obfp = obf;
}
}
} else {
- debug(1, "error %d during decoding. Gross data size: %d", ret, incoming_data_length);
+ debug(1, "error %d during decoding. Gross data size: %ld", ret, incoming_data_length);
/*
char obf[128];
char *obfp = obf;
// } else {
if (len <= 8) {
debug(1,
- "Using the FFMPEG ALAC_44100_S16_2 decoder, a short audio packet %u, rtptime %u, of length %u has been decoded but not discarded. Contents follow:", seqno,
+ "Using the FFMPEG ALAC_44100_S16_2 decoder, a short audio packet %u, rtptime %u, of length %lu has been decoded but not discarded. Contents follow:", seqno,
actual_timestamp, len);
debug_print_buffer(1, data, len);
// abuf->length = conn->frames_per_packet;
//} else {
if (len <= 8) {
debug(1,
- "Using an FFMPEG decoder, a short audio packet %u, rtptime %u, of length %u has been decoded but not discarded. Contents follow:", seqno,
+ "Using an FFMPEG decoder, a short audio packet %u, rtptime %u, of length %lu has been decoded but not discarded. Contents follow:", seqno,
actual_timestamp, len);
debug_print_buffer(1, data, len);
// abuf->length = 0;
#ifdef CONFIG_METADATA
if (conn->ab_buffering == 0) {
if ((curframe) && (curframe->ready) && (curframe->timestamp))
- debug(3, "Current frame at \"resume\" is %u.", curframe->timestamp);
+ debug(3, "Current frame timestamp at \"resume\" is %u.", curframe->timestamp);
else
- debug(1, "Current frame at \"resume\" is not known.", curframe->timestamp);
+ debug(1, "Current frame at \"resume\" is not known.");
send_ssnc_metadata('prsm', NULL, 0,
0); // "resume", but don't wait if the queue is locked
int ptp_shm_interface_open() {
int response = 0;
- debug(3, "ptp_shm_interface_open with mapped_addr = %" PRIuPTR "", mapped_addr);
+ debug(3, "ptp_shm_interface_open with mapped_addr = %" PRIuPTR "", (uintptr_t)mapped_addr);
if ((mapped_addr == NULL) || (mapped_addr == MAP_FAILED)) {
response = -1;
if (mapped_addr == NULL)
char *packet_in_hex_cstring =
debug_malloc_hex_cstring(packet, nread); // remember to free this afterwards
debug(1,
- "AP2 Control Receiver Packet of first byte 0x%02X, type 0x%02X length %d "
+ "AP2 Control Receiver Packet of first byte 0x%02X, type 0x%02X length %ld "
"received: "
"\"%s\".",
packet[0], packet[1], nread, packet_in_hex_cstring);
conn->connection_number, errno);
}
} else {
- debug(2, "Connection %d: AP2 Control Receiver -- malformed packet, %d bytes long.",
+ debug(2, "Connection %d: AP2 Control Receiver -- malformed packet, %ld bytes long.",
conn->connection_number, nread);
}
}
debug(2, "Realtime Audio Receiver Cleanup Start.");
rtsp_conn_info *conn = (rtsp_conn_info *)arg;
close(conn->realtime_audio_socket);
- debug(2, "Connection %d: closing realtime audio port %u", conn->local_realtime_audio_port);
+ debug(2, "Connection %d: closing realtime audio port %u", conn->connection_number, conn->local_realtime_audio_port);
conn->realtime_audio_socket = 0;
debug(2, "Realtime Audio Receiver Cleanup Done.");
}
ssize_t consumed = pair_decrypt(&plain, &plain_len, ctx->encrypted_read_buffer.data,
ctx->encrypted_read_buffer.length, ctx->cipher_ctx);
if (consumed < 0) {
- debug(1, "read_encrypted: abnormal exit from pair_decrypt: %d.", consumed);
+ debug(1, "read_encrypted: abnormal exit from pair_decrypt: %ld.", consumed);
response = -1;
} else {
buf_drain(&ctx->encrypted_read_buffer, consumed);
}
plist_dict_set_item(supported_formats_plist, "bufferStream",
plist_new_uint(bufferStreamFormats));
- debug(3, "bufferedStream formats: 0x% " PRIX64 ".", bufferStreamFormats);
+ debug(3, "bufferedStream formats: 0x%" PRIX64 ".", bufferStreamFormats);
plist_dict_set_item(response_plist, "supportedFormats", supported_formats_plist);
}
}
conn->ap2_immediate_flush_until_sequence_number = flushUntilSeq & 0x7fffff;
conn->ap2_immediate_flush_until_rtp_timestamp = flushUntilTS;
debug(2,
- "Connection %d: immediate flush request created: flushUntilTS: %u, flushUntilSeq: %u.",
+ "Connection %d: immediate flush request created: flushUntilTS: %" PRIu64 ", flushUntilSeq: %" PRIu64 ".",
conn->connection_number, flushUntilTS, flushUntilSeq & 0x7fffff);
conn->ap2_play_enabled = 0; // stop trying to play audio
ptp_send_control_message_string(
conn->ap2_deferred_flush_requests[i].flushUntilSeq = flushUntilSeq & 0x7fffff;
conn->ap2_deferred_flush_requests[i].flushUntilTS = flushUntilTS;
debug(2,
- "Connection %d: deferred flush request created: flushFromSeq: %u, flushUntilSeq: %u.",
+ "Connection %d: deferred flush request created: flushFromSeq: %" PRIu64 ", flushUntilSeq: %" PRIu64 ".",
conn->connection_number, flushFromSeq, flushUntilSeq);
} else {
debug(1, "Connection %d: no more room for deferred flush request records",
}
} else if (conn->airplay_stream_category == ntp_stream) {
debug(1, "SETUP on Connection %d: ntp stream handling is not implemented!",
- conn->connection_number, req);
+ conn->connection_number);
warn("Shairport Sync can not handle NTP streams.");
} else if (conn->airplay_stream_category == remote_control_stream) {
if (pack.carrier) {
if (rc == EWOULDBLOCK)
debug(2,
- "metadata queue \"%s\" full, dropping message item: type %x, code %x, data %x, "
+ "metadata queue \"%s\" full, dropping message item: type %x, code %x, data %" PRIxPTR ", "
"length %u, message %d.",
- queue->name, pack.type, pack.code, pack.data, pack.length,
+ queue->name, pack.type, pack.code, (uintptr_t)pack.data, pack.length,
pack.carrier->index_number);
msg_free(&pack.carrier);
} else {
if (rc == EWOULDBLOCK)
debug(
2,
- "metadata queue \"%s\" full, dropping data item: type %x, code %x, data %x, length %u.",
- queue->name, pack.type, pack.code, pack.data, pack.length);
+ "metadata queue \"%s\" full, dropping data item: type %x, code %x, data %" PRIxPTR ", length %u.",
+ queue->name, pack.type, pack.code, (uintptr_t)pack.data, pack.length);
if (pack.data)
free(pack.data);
}
// Produces a UUID string at uuid consisting of lower-case letters
uuid_unparse_lower(result, psi_uuid);
config.airplay_psi = psi_uuid;
- debug(3, "size of pk is %u.", sizeof(config.airplay_pk));
+ debug(3, "size of pk is %lu.", sizeof(config.airplay_pk));
pair_public_key_get(PAIR_SERVER_HOMEKIT, config.airplay_pk, config.airplay_device_id);
char buf[128];
(config_lookup_non_empty_string(config.cfg, "general.mixdown", &str))) {
if ((strcasecmp(str, "off") == 0) || (strcasecmp(str, "no") == 0)) {
config.mixdown_enable = 0; // 0 on initialisation
- debug(1, "mixdown disabled.", str);
+ debug(1, "mixdown disabled.");
} else if (strcasecmp(str, "auto") == 0) {
config.mixdown_enable = 1;
config.mixdown_channel_layout = 0; // 0 means auto
- debug(1, "mixdown target: auto.", str);
+ debug(1, "mixdown target: auto.");
} else {
AVChannelLayout channel_layout;
if (av_channel_layout_from_string(&channel_layout, str) == 0) {
debug(option_print_level, "metadata pipename is \"%s\".", config.metadata_pipename);
debug(option_print_level, "metadata socket address is \"%s\" port %d.", config.metadata_sockaddr,
config.metadata_sockport);
- debug(option_print_level, "metadata socket packet size is \"%d\".",
+ debug(option_print_level, "metadata socket packet size is \"%ld\".",
config.metadata_sockmsglength);
debug(option_print_level, "get-coverart is %d.", config.get_coverart);
#endif
descriptor->closed = 0;
if (descriptor->buffer_occupancy == 0) {
- debug(2, "buffered_read: buffer empty -- waiting for %u bytes.", count);
+ debug(2, "buffered_read: buffer empty -- waiting for %lu 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");
else
- debug(2, "buffered_read: signalled with %u bytes after waiting.",
+ debug(2, "buffered_read: signalled with %lu bytes after waiting.",
descriptor->buffer_occupancy);
}
// do the read
if (descriptor->buffer_occupancy == 0)
- debug(2, "recv of up to %d bytes with an buffer empty.", bytes_to_request);
+ debug(2, "recv of up to %ld bytes with an buffer empty.", bytes_to_request);
nread = recv(fd, descriptor->eoq, bytes_to_request, 0);
// debug(1, "Received %d bytes for a buffer size of %d bytes.",nread,
// descriptor->buffer_occupancy + nread);