diff options
-rw-r--r-- | auto_tests/toxav_basic_test.c | 4 | ||||
-rw-r--r-- | auto_tests/toxav_many_test.c | 4 | ||||
-rw-r--r-- | toxav/toxav.c | 18 | ||||
-rw-r--r-- | toxav/toxav.h | 6 | ||||
-rw-r--r-- | toxcore/LAN_discovery.c | 6 | ||||
-rw-r--r-- | toxcore/TCP_client.c | 1 |
6 files changed, 18 insertions, 21 deletions
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 ) | |||
163 | cast->Alice.status = TimedOut; | 163 | cast->Alice.status = TimedOut; |
164 | } | 164 | } |
165 | 165 | ||
166 | static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length, void* userdata) | 166 | static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length, void *userdata) |
167 | { | 167 | { |
168 | } | 168 | } |
169 | 169 | ||
170 | static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img, void* userdata) | 170 | static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img, void *userdata) |
171 | { | 171 | { |
172 | } | 172 | } |
173 | 173 | ||
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 ) | |||
120 | //ck_assert_msg(0, "No answer!"); | 120 | //ck_assert_msg(0, "No answer!"); |
121 | } | 121 | } |
122 | 122 | ||
123 | static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length, void* userdata) | 123 | static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length, void *userdata) |
124 | { | 124 | { |
125 | } | 125 | } |
126 | 126 | ||
127 | static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img, void* userdata) | 127 | static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img, void *userdata) |
128 | { | 128 | { |
129 | } | 129 | } |
130 | 130 | ||
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 { | |||
97 | } DECODE_PACKET; | 97 | } DECODE_PACKET; |
98 | 98 | ||
99 | #define VIDEO_DECODE_QUEUE_SIZE 2 | 99 | #define VIDEO_DECODE_QUEUE_SIZE 2 |
100 | #define AUDIO_DECODE_QUEUE_SIZE 8 | 100 | #define AUDIO_DECODE_QUEUE_SIZE 16 |
101 | 101 | ||
102 | struct _ToxAv { | 102 | struct _ToxAv { |
103 | Messenger *messenger; | 103 | Messenger *messenger; |
104 | MSISession *msi_session; /** Main msi session */ | 104 | MSISession *msi_session; /** Main msi session */ |
105 | CallSpecific *calls; /** Per-call params */ | 105 | CallSpecific *calls; /** Per-call params */ |
106 | 106 | ||
107 | void (*audio_callback)(ToxAv *, int32_t, int16_t *, int, void*); | 107 | void (*audio_callback)(ToxAv *, int32_t, int16_t *, int, void *); |
108 | void (*video_callback)(ToxAv *, int32_t, vpx_image_t *, void*); | 108 | void (*video_callback)(ToxAv *, int32_t, vpx_image_t *, void *); |
109 | 109 | ||
110 | void *audio_callback_userdata; | 110 | void *audio_callback_userdata; |
111 | void *video_callback_userdata; | 111 | void *video_callback_userdata; |
112 | 112 | ||
@@ -272,7 +272,8 @@ void toxav_register_callstate_callback ( ToxAv *av, ToxAVCallback callback, ToxA | |||
272 | * @param callback The callback | 272 | * @param callback The callback |
273 | * @return void | 273 | * @return void |
274 | */ | 274 | */ |
275 | void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int, void*), void* user_data) | 275 | void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int, void *), |
276 | void *user_data) | ||
276 | { | 277 | { |
277 | av->audio_callback = callback; | 278 | av->audio_callback = callback; |
278 | av->audio_callback_userdata = user_data; | 279 | av->audio_callback_userdata = user_data; |
@@ -284,7 +285,8 @@ void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, in | |||
284 | * @param callback The callback | 285 | * @param callback The callback |
285 | * @return void | 286 | * @return void |
286 | */ | 287 | */ |
287 | void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *, void*), void* user_data) | 288 | void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *, void *), |
289 | void *user_data) | ||
288 | { | 290 | { |
289 | av->video_callback = callback; | 291 | av->video_callback = callback; |
290 | av->video_callback_userdata = user_data; | 292 | av->video_callback_userdata = user_data; |
@@ -1081,7 +1083,7 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg) | |||
1081 | av->audio_decode_write = (w + 1) % AUDIO_DECODE_QUEUE_SIZE; | 1083 | av->audio_decode_write = (w + 1) % AUDIO_DECODE_QUEUE_SIZE; |
1082 | pthread_cond_signal(&av->decode_cond); | 1084 | pthread_cond_signal(&av->decode_cond); |
1083 | } else { | 1085 | } else { |
1084 | printf("dropped audio frame\n"); | 1086 | LOGGER_DEBUG("Dropped audio frame\n"); |
1085 | free(p); | 1087 | free(p); |
1086 | } | 1088 | } |
1087 | 1089 | ||
@@ -1121,7 +1123,7 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg) | |||
1121 | av->video_decode_write = (w + 1) % VIDEO_DECODE_QUEUE_SIZE; | 1123 | av->video_decode_write = (w + 1) % VIDEO_DECODE_QUEUE_SIZE; |
1122 | pthread_cond_signal(&av->decode_cond); | 1124 | pthread_cond_signal(&av->decode_cond); |
1123 | } else { | 1125 | } else { |
1124 | printf("dropped video frame\n"); | 1126 | LOGGER_DEBUG("Dropped video frame\n"); |
1125 | free(p); | 1127 | free(p); |
1126 | } | 1128 | } |
1127 | 1129 | ||
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 | |||
173 | * @param callback The callback | 173 | * @param callback The callback |
174 | * @return void | 174 | * @return void |
175 | */ | 175 | */ |
176 | void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int, void*), void* user_data); | 176 | void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, int16_t *, int, void *), |
177 | void *user_data); | ||
177 | 178 | ||
178 | /** | 179 | /** |
179 | * @brief Register callback for recieving video data | 180 | * @brief Register callback for recieving video data |
@@ -182,7 +183,8 @@ void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, in | |||
182 | * @param callback The callback | 183 | * @param callback The callback |
183 | * @return void | 184 | * @return void |
184 | */ | 185 | */ |
185 | void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *, void*), void* user_data); | 186 | void toxav_register_video_recv_callback (ToxAv *av, void (*callback)(ToxAv *, int32_t, vpx_image_t *, void *), |
187 | void *user_data); | ||
186 | 188 | ||
187 | /** | 189 | /** |
188 | * @brief Call user. Use its friend_id. | 190 | * @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) | |||
46 | unsigned long ulOutBufLen = sizeof(pAdapterInfo); | 46 | unsigned long ulOutBufLen = sizeof(pAdapterInfo); |
47 | 47 | ||
48 | if (pAdapterInfo == NULL) { | 48 | if (pAdapterInfo == NULL) { |
49 | printf("Error allocating memory for pAdapterInfo\n"); | ||
50 | return; | 49 | return; |
51 | } | 50 | } |
52 | 51 | ||
@@ -55,7 +54,6 @@ static void fetch_broadcast_info(uint16_t port) | |||
55 | pAdapterInfo = malloc(ulOutBufLen); | 54 | pAdapterInfo = malloc(ulOutBufLen); |
56 | 55 | ||
57 | if (pAdapterInfo == NULL) { | 56 | if (pAdapterInfo == NULL) { |
58 | printf("Error allocating memory needed to call GetAdaptersinfo\n"); | ||
59 | return; | 57 | return; |
60 | } | 58 | } |
61 | } | 59 | } |
@@ -78,7 +76,6 @@ static void fetch_broadcast_info(uint16_t port) | |||
78 | ip_port->ip.ip4.uint32 = htonl(broadcast_ip); | 76 | ip_port->ip.ip4.uint32 = htonl(broadcast_ip); |
79 | ip_port->port = port; | 77 | ip_port->port = port; |
80 | broadcast_count++; | 78 | broadcast_count++; |
81 | printf("broadcast ip: %s\n", ip_ntoa(&ip_port->ip)); | ||
82 | 79 | ||
83 | if (broadcast_count >= MAX_INTERFACES) { | 80 | if (broadcast_count >= MAX_INTERFACES) { |
84 | return; | 81 | return; |
@@ -88,10 +85,7 @@ static void fetch_broadcast_info(uint16_t port) | |||
88 | 85 | ||
89 | pAdapter = pAdapter->Next; | 86 | pAdapter = pAdapter->Next; |
90 | } | 87 | } |
91 | } else { | ||
92 | printf("Fetching adapter info failed %i\n", ret); | ||
93 | } | 88 | } |
94 | |||
95 | } | 89 | } |
96 | 90 | ||
97 | #elif defined(__linux__) | 91 | #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 | |||
460 | sock_t sock = socket(ip_port.ip.family, SOCK_STREAM, IPPROTO_TCP); | 460 | sock_t sock = socket(ip_port.ip.family, SOCK_STREAM, IPPROTO_TCP); |
461 | 461 | ||
462 | if (!sock_valid(sock)) { | 462 | if (!sock_valid(sock)) { |
463 | printf("fail1 %u\n", sock); | ||
464 | return NULL; | 463 | return NULL; |
465 | } | 464 | } |
466 | 465 | ||