cleanup printf statements

This commit is contained in:
F. Duncanh
2024-12-13 10:32:50 -05:00
parent 2ebc2b032f
commit 45b8c0d1c2
5 changed files with 21 additions and 39 deletions

View File

@@ -343,7 +343,6 @@ int gcm_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *pl
return plaintext_len;
} else {
/* Verify failed */
printf("failed\n");
return -1;
}
}

View File

@@ -413,22 +413,22 @@ httpd_thread(void *arg)
logger_log(httpd->logger, LOGGER_DEBUG, "httpd receiving on socket %d, connection %d",
connection->socket_fd, i);
if (logger_debug) {
printf("\nhttpd: current connections:\n");
logger_log(httpd->logger, LOGGER_DEBUG,"\nhttpd: current connections:");
for (int i = 0; i < httpd->max_connections; i++) {
http_connection_t *connection = &httpd->connections[i];
if(!connection->connected) {
continue;
}
if (!FD_ISSET(connection->socket_fd, &rfds)) {
printf("connection %d type %d socket %d conn %p %s\n", i,
connection->type, connection->socket_fd,
connection->user_data, typename [connection->type]);
logger_log(httpd->logger, LOGGER_DEBUG, "connection %d type %d socket %d conn %p %s", i,
connection->type, connection->socket_fd,
connection->user_data, typename [connection->type]);
} else {
printf("connection %d type %d socket %d conn %p %s ACTIVE CONNECTION\n", i, connection->type,
connection->socket_fd, connection->user_data, typename [connection->type]);
logger_log(httpd->logger, LOGGER_DEBUG, "connection %d type %d socket %d conn %p %s ACTIVE CONNECTION",
i, connection->type, connection->socket_fd, connection->user_data, typename [connection->type]);
}
}
printf("\n");
logger_log(httpd->logger, LOGGER_DEBUG, " ");
}
/* reverse-http responses from the client must not be sent to the llhttp parser:
* such messages start with "HTTP/1.1" */

View File

@@ -311,19 +311,16 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) {
char * plist_xml;
uint32_t plist_len;
plist_to_xml(req_root_node, &plist_xml, &plist_len);
printf("%s\n",plist_xml);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml);
free(plist_xml);
plist_free(req_root_node);
} else if (data_is_text) {
char *data_str = utils_data_to_text((char *) request_data, request_datalen);
printf("%s\n", data_str);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
free(data_str);
} else {
char *data_str = utils_data_to_string((unsigned char *) request_data, request_datalen, 16);
printf("%s\n", data_str);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
free(data_str);
}
}
@@ -449,18 +446,15 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) {
uint32_t plist_len;
plist_to_xml(res_root_node, &plist_xml, &plist_len);
plist_free(res_root_node);
printf("%s\n", plist_xml);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml);
free(plist_xml);
} else if (data_is_text) {
char *data_str = utils_data_to_text((char*) response_data, response_datalen);
printf("%s\n", data_str);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
free(data_str);
} else {
char *data_str = utils_data_to_string((unsigned char *) response_data, response_datalen, 16);
printf("%s\n", data_str);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
free(data_str);
}
}

View File

@@ -541,9 +541,6 @@ raop_rtp_mirror_thread(void *arg)
raop_rtp_mirror->callbacks.video_process(raop_rtp_mirror->callbacks.cls, raop_rtp_mirror->ntp, &video_data);
free(payload_out);
break;
//char *str3 = utils_data_to_string(payload_out, video_data.data_len, 16);
//printf("%s\n", str3);
//free (str3);
case 0x01:
/* 128-byte observed packet header structure
bytes 0-15: length + timestamp
@@ -609,13 +606,12 @@ raop_rtp_mirror_thread(void *arg)
free(sps_pps);
sps_pps = NULL;
}
/* test for a H265 VPS/SPs/PPS */
/* test for a H265 VPS/SPS/PPS */
unsigned char hvc1[] = { 0x68, 0x76, 0x63, 0x31 };
if (!memcmp(payload + 4, hvc1, 4)) {
/* hvc1 HECV detected */
codec = VIDEO_CODEC_H265;
printf("h265 detected\n");
h265_video = true;
raop_rtp_mirror->callbacks.video_set_codec(raop_rtp_mirror->callbacks.cls, codec);
unsigned char vps_start_code[] = { 0xa0, 0x00, 0x01, 0x00 };
@@ -687,10 +683,6 @@ raop_rtp_mirror_thread(void *arg)
memcpy(ptr, nal_start_code, 4);
ptr += 4;
memcpy(ptr, pps, pps_size);
// printf (" HEVC (hvc1) vps + sps + pps NALU\n");
//char *str = utils_data_to_string(sps_pps, sps_pps_len, 16);
//printf("%s\n", str);
//free (str);
} else {
codec = VIDEO_CODEC_H264;
h265_video = false;

View File

@@ -1575,7 +1575,6 @@ extern "C" void conn_reset (void *cls, int timeouts, bool reset_video) {
LOGI(" Sometimes the network connection may recover after a longer delay:\n"
" the default timeout limit n = %d can be changed with the \"-reset n\" option", NTP_TIMEOUT_LIMIT);
}
printf("reset_video %d\n",(int) reset_video);
if (!nofreeze) {
close_window = reset_video; /* leave "frozen" window open if reset_video is false */
}
@@ -1880,9 +1879,7 @@ extern "C" void on_video_acquire_playback_info (void *cls, playback_info_t *play
LOGI(" video has finished, %f", playback_info->position);
playback_info->position = -1.0;
playback_info->duration = -1.0;
printf("about to stop\n");
video_renderer_stop();
printf("stopped\n");
}
}
@@ -2083,8 +2080,8 @@ static void read_config_file(const char * filename, const char * uxplay_name) {
void real_main (int argc, char *argv[]);
int main (int argc, char *argv[]) {
printf("*=== Using gst_macos_main wrapper for GStreamer >= 1.22 on macOS ===*\n");
return gst_macos_main ((GstMainFunc) real_main, argc, argv , NULL);
LOGI("*=== Using gst_macos_main wrapper for GStreamer >= 1.22 on macOS ===*");
return gst_macos_main ((GstMainFunc) real_main, argc, argv , NULL);
}
void real_main (int argc, char *argv[]) {
@@ -2124,22 +2121,22 @@ int main (int argc, char *argv[]) {
}
if (dump_video) {
if (video_dump_limit > 0) {
printf("dump video using \"-vdmp %d %s\"\n", video_dump_limit, video_dumpfile_name.c_str());
LOGI("dump video using \"-vdmp %d %s\"", video_dump_limit, video_dumpfile_name.c_str());
} else {
printf("dump video using \"-vdmp %s\"\n", video_dumpfile_name.c_str());
LOGI("dump video using \"-vdmp %s\"", video_dumpfile_name.c_str());
}
}
if (dump_audio) {
if (audio_dump_limit > 0) {
printf("dump audio using \"-admp %d %s\"\n", audio_dump_limit, audio_dumpfile_name.c_str());
LOGI("dump audio using \"-admp %d %s\"", audio_dump_limit, audio_dumpfile_name.c_str());
} else {
printf("dump audio using \"-admp %s\"\n", audio_dumpfile_name.c_str());
LOGI("dump audio using \"-admp %s\"", audio_dumpfile_name.c_str());
}
}
#if __APPLE__
/* force use of -nc option on macOS */
LOGI("macOS detected: use -nc option as workaround for GStreamer problem");
LOGI("macOS detected: using -nc option as workaround for GStreamer problem");
new_window_closing_behavior = false;
#endif