diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-06-23 17:16:28 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-06-24 19:17:32 +0000 |
commit | 8e00294b3cb9808ce55160240454359638178275 (patch) | |
tree | 095a7708b3fe3566951ebe7b068ee66a8beed3c1 /toxav/groupav.c | |
parent | 5a8790eab0ed9421445adce40526462b9e6742c3 (diff) |
Add Logger to various net_crypto functions.
In preparation for adding log statements.
Also, fix an uninitialised variable warning in cppcheck.
Diffstat (limited to 'toxav/groupav.c')
-rw-r--r-- | toxav/groupav.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/toxav/groupav.c b/toxav/groupav.c index f0cb3a5b..97baac39 100644 --- a/toxav/groupav.c +++ b/toxav/groupav.c | |||
@@ -159,7 +159,7 @@ static Group_Audio_Packet *dequeue(Group_JitterBuffer *q, int *success) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | typedef struct { | 161 | typedef struct { |
162 | Logger *log; | 162 | const Logger *log; |
163 | Group_Chats *g_c; | 163 | Group_Chats *g_c; |
164 | OpusEncoder *audio_encoder; | 164 | OpusEncoder *audio_encoder; |
165 | 165 | ||
@@ -227,8 +227,8 @@ static int recreate_encoder(Group_AV *group_av) | |||
227 | return 0; | 227 | return 0; |
228 | } | 228 | } |
229 | 229 | ||
230 | static Group_AV *new_group_av(Logger *log, Group_Chats *g_c, void (*audio_callback)(Messenger *, uint32_t, uint32_t, | 230 | static Group_AV *new_group_av(const Logger *log, Group_Chats *g_c, void (*audio_callback)(Messenger *, uint32_t, |
231 | const int16_t *, unsigned int, uint8_t, uint32_t, void *), void *userdata) | 231 | uint32_t, const int16_t *, unsigned int, uint8_t, uint32_t, void *), void *userdata) |
232 | { | 232 | { |
233 | if (!g_c) { | 233 | if (!g_c) { |
234 | return nullptr; | 234 | return nullptr; |
@@ -429,9 +429,9 @@ static int handle_group_audio_packet(void *object, uint32_t groupnumber, uint32_ | |||
429 | * return 0 on success. | 429 | * return 0 on success. |
430 | * return -1 on failure. | 430 | * return -1 on failure. |
431 | */ | 431 | */ |
432 | static int groupchat_enable_av(Logger *log, Group_Chats *g_c, uint32_t groupnumber, void (*audio_callback)(Messenger *, | 432 | static int groupchat_enable_av(const Logger *log, Group_Chats *g_c, uint32_t groupnumber, |
433 | uint32_t, | 433 | void (*audio_callback)(Messenger *, |
434 | uint32_t, const int16_t *, unsigned int, uint8_t, uint32_t, void *), void *userdata) | 434 | uint32_t, uint32_t, const int16_t *, unsigned int, uint8_t, uint32_t, void *), void *userdata) |
435 | { | 435 | { |
436 | Group_AV *group_av = new_group_av(log, g_c, audio_callback, userdata); | 436 | Group_AV *group_av = new_group_av(log, g_c, audio_callback, userdata); |
437 | 437 | ||
@@ -456,10 +456,8 @@ static int groupchat_enable_av(Logger *log, Group_Chats *g_c, uint32_t groupnumb | |||
456 | * return group number on success. | 456 | * return group number on success. |
457 | * return -1 on failure. | 457 | * return -1 on failure. |
458 | */ | 458 | */ |
459 | int add_av_groupchat(Logger *log, Group_Chats *g_c, void (*audio_callback)(Messenger *, uint32_t, uint32_t, | 459 | int add_av_groupchat(const Logger *log, Group_Chats *g_c, void (*audio_callback)(Messenger *, uint32_t, uint32_t, |
460 | const int16_t *, | 460 | const int16_t *, unsigned int, uint8_t, uint32_t, void *), void *userdata) |
461 | unsigned int, | ||
462 | uint8_t, uint32_t, void *), void *userdata) | ||
463 | { | 461 | { |
464 | int groupnumber = add_groupchat(g_c, GROUPCHAT_TYPE_AV); | 462 | int groupnumber = add_groupchat(g_c, GROUPCHAT_TYPE_AV); |
465 | 463 | ||
@@ -480,7 +478,7 @@ int add_av_groupchat(Logger *log, Group_Chats *g_c, void (*audio_callback)(Messe | |||
480 | * returns group number on success | 478 | * returns group number on success |
481 | * returns -1 on failure. | 479 | * returns -1 on failure. |
482 | */ | 480 | */ |
483 | int join_av_groupchat(Logger *log, Group_Chats *g_c, uint32_t friendnumber, const uint8_t *data, uint16_t length, | 481 | int join_av_groupchat(const Logger *log, Group_Chats *g_c, uint32_t friendnumber, const uint8_t *data, uint16_t length, |
484 | void (*audio_callback)(Messenger *, uint32_t, uint32_t, const int16_t *, unsigned int, uint8_t, uint32_t, void *), | 482 | void (*audio_callback)(Messenger *, uint32_t, uint32_t, const int16_t *, unsigned int, uint8_t, uint32_t, void *), |
485 | void *userdata) | 483 | void *userdata) |
486 | { | 484 | { |