diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index 6db9f8fa..57685bfc 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c @@ -163,11 +163,11 @@ void callback_requ_timeout ( void *av, int32_t call_index, void *_arg ) cast->Alice.status = TimedOut; } -static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length, void* userdata) +static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length, void *userdata) { } -static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img, void* userdata) +static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img, void *userdata) { } diff --git a/auto_tests/toxav_many_test.c b/auto_tests/toxav_many_test.c index d98824be..d9c588f7 100644 --- a/auto_tests/toxav_many_test.c +++ b/auto_tests/toxav_many_test.c @@ -120,11 +120,11 @@ void callback_requ_timeout ( void *av, int32_t call_index, void *_arg ) //ck_assert_msg(0, "No answer!"); } -static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length, void* userdata) +static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length, void *userdata) { } -static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img, void* userdata) +static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img, void *userdata) { } diff --git a/toxav/toxav.c b/toxav/toxav.c index d544d2f5..0c3a1c8f 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -97,16 +97,16 @@ typedef struct { } DECODE_PACKET; #define VIDEO_DECODE_QUEUE_SIZE 2 -#define AUDIO_DECODE_QUEUE_SIZE 8 +#define AUDIO_DECODE_QUEUE_SIZE 16 struct _ToxAv { Messenger *messenger; MSISession *msi_session; /** Main msi session */ CallSpecific *calls; /** Per-call params */ - void (*audio_callback)(ToxAv *, int32_t, int16_t *, int, void*); - void (*video_callback)(ToxAv *, int32_t, vpx_image_t *, void*); - + void (*audio_callback)(ToxAv *, int32_t, int16_t *, int, void *); + void (*video_callback)(ToxAv *, int32_t, vpx_image_t *, void *); + void *audio_callback_userdata; void *video_callback_userdata; @@ -272,7 +272,8 @@ void toxav_register_callstate_callback ( ToxAv *av, ToxAVCallback callback, ToxA * @param callback The callback * @return void */ -void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int, void*), void* user_data) +void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int, void *), + void *user_data) { av->audio_callback = callback; av->audio_callback_userdata = user_data; @@ -284,7 +285,8 @@ void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, in * @param callback The callback * @return void */ -void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *, void*), void* user_data) +void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *, void *), + void *user_data) { av->video_callback = callback; av->video_callback_userdata = user_data; @@ -1081,7 +1083,7 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg) av->audio_decode_write = (w + 1) % AUDIO_DECODE_QUEUE_SIZE; pthread_cond_signal(&av->decode_cond); } else { - printf("dropped audio frame\n"); + LOGGER_DEBUG("Dropped audio frame\n"); free(p); } @@ -1121,7 +1123,7 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg) av->video_decode_write = (w + 1) % VIDEO_DECODE_QUEUE_SIZE; pthread_cond_signal(&av->decode_cond); } else { - printf("dropped video frame\n"); + LOGGER_DEBUG("Dropped video frame\n"); free(p); } diff --git a/toxav/toxav.h b/toxav/toxav.h index 0dcd2836..e31c7aad 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h @@ -173,7 +173,8 @@ void toxav_register_callstate_callback (ToxAv *av, ToxAVCallback callback, ToxAv * @param callback The callback * @return void */ -void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int, void*), void* user_data); +void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int, void *), + void *user_data); /** * @brief Register callback for recieving video data @@ -182,7 +183,8 @@ void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, in * @param callback The callback * @return void */ -void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *, void*), void* user_data); +void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *, void *), + void *user_data); /** * @brief Call user. Use its friend_id. diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index 420c490d..3c05fe8d 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c @@ -46,7 +46,6 @@ static void fetch_broadcast_info(uint16_t port) unsigned long ulOutBufLen = sizeof(pAdapterInfo); if (pAdapterInfo == NULL) { - printf("Error allocating memory for pAdapterInfo\n"); return; } @@ -55,7 +54,6 @@ static void fetch_broadcast_info(uint16_t port) pAdapterInfo = malloc(ulOutBufLen); if (pAdapterInfo == NULL) { - printf("Error allocating memory needed to call GetAdaptersinfo\n"); return; } } @@ -78,7 +76,6 @@ static void fetch_broadcast_info(uint16_t port) ip_port->ip.ip4.uint32 = htonl(broadcast_ip); ip_port->port = port; broadcast_count++; - printf("broadcast ip: %s\n", ip_ntoa(&ip_port->ip)); if (broadcast_count >= MAX_INTERFACES) { return; @@ -88,10 +85,7 @@ static void fetch_broadcast_info(uint16_t port) pAdapter = pAdapter->Next; } - } else { - printf("Fetching adapter info failed %i\n", ret); } - } #elif defined(__linux__) diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c index 45220538..ff92d215 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c @@ -460,7 +460,6 @@ TCP_Client_Connection *new_TCP_connection(IP_Port ip_port, const uint8_t *public sock_t sock = socket(ip_port.ip.family, SOCK_STREAM, IPPROTO_TCP); if (!sock_valid(sock)) { - printf("fail1 %u\n", sock); return NULL; }