Skip to content

Commit

Permalink
address some of my review 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Sep 20, 2024
1 parent 32f88ef commit dac5f88
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion toxav/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
8 changes: 1 addition & 7 deletions toxav/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions toxav/rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

/**
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions toxav/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit dac5f88

Please sign in to comment.