diff --git a/toxav/audio.c b/toxav/audio.c index a84df89ae8..0f0b25216a 100644 --- a/toxav/audio.c +++ b/toxav/audio.c @@ -28,7 +28,7 @@ static bool reconfigure_audio_decoder(ACSession *ac, uint32_t sampling_rate, uin -ACSession *ac_new(Mono_Time *mono_time, const Logger *log, Tox *tox, ToxAV *av, uint32_t friend_number, +ACSession *ac_new(Mono_Time *mono_time, const Logger *log, ToxAV *av, uint32_t friend_number, toxav_audio_receive_frame_cb *cb, void *cb_data) { ACSession *ac = (ACSession *)calloc(1, sizeof(ACSession)); diff --git a/toxav/audio.h b/toxav/audio.h index d7d8fd8b1a..3ae4251137 100644 --- a/toxav/audio.h +++ b/toxav/audio.h @@ -34,11 +34,6 @@ #define AUDIO_MAX_BUFFER_SIZE_PCM16 ((AUDIO_MAX_SAMPLE_RATE * AUDIO_MAX_FRAME_DURATION_MS) / 1000) #define AUDIO_MAX_BUFFER_SIZE_BYTES (AUDIO_MAX_BUFFER_SIZE_PCM16 * 2) -#ifndef TOX_DEFINED -#define TOX_DEFINED -typedef struct Tox Tox; -#endif /* TOX_DEFINED */ - typedef struct ACSession { Mono_Time *mono_time; const Logger *log; @@ -66,10 +61,9 @@ typedef struct ACSession { /* Audio frame receive callback */ toxav_audio_receive_frame_cb *acb; void *acb_user_data; - Tox *tox; } ACSession; -ACSession *ac_new(Mono_Time *mono_time, const Logger *log, Tox *tox, ToxAV *av, uint32_t friend_number, +ACSession *ac_new(Mono_Time *mono_time, const Logger *log, ToxAV *av, uint32_t friend_number, toxav_audio_receive_frame_cb *cb, void *cb_data); void ac_kill(ACSession *ac); void ac_iterate(ACSession *ac); diff --git a/toxav/rtp.c b/toxav/rtp.c index bb3fa14fe1..32b2545d84 100644 --- a/toxav/rtp.c +++ b/toxav/rtp.c @@ -19,7 +19,6 @@ #include "../toxcore/mono_time.h" #include "../toxcore/net_crypto.h" #include "../toxcore/tox_private.h" -#include "../toxcore/tox_struct.h" #include "../toxcore/util.h" /** @@ -676,10 +675,8 @@ size_t rtp_header_unpack(const uint8_t *data, struct RTPHeader *header) static uint32_t rtp_random_u32(void) { - uint32_t randnum; // HINT: uses libsodium function - randombytes((uint8_t *)&randnum, sizeof(randnum)); - return randnum; + return randombytes_random(); } RTPSession *rtp_new(const Logger *log, int payload_type, Tox *tox, ToxAV *toxav, uint32_t friendnumber, diff --git a/toxav/video.h b/toxav/video.h index 98e937d984..7bd54fa631 100644 --- a/toxav/video.h +++ b/toxav/video.h @@ -21,11 +21,6 @@ #include "ring_buffer.h" #include "rtp.h" -#ifndef TOX_DEFINED -#define TOX_DEFINED -typedef struct Tox Tox; -#endif /* TOX_DEFINED */ - typedef struct VCSession { /* encoding */ vpx_codec_ctx_t encoder[1];