From 657a57b406717a3ff08233eef14f20818c137f47 Mon Sep 17 00:00:00 2001 From: mannol Date: Fri, 7 Aug 2015 02:04:04 +0200 Subject: [PATCH] Fixed memory leak during session cleanup and fixed naming. --- other/apidsl/toxav.in.h | 4 ++-- testing/av_test.c | 5 ----- toxav/audio.c | 1 + toxav/rtp.c | 3 ++- toxav/toxav.h | 4 ++-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/other/apidsl/toxav.in.h b/other/apidsl/toxav.in.h index 22a01602..f437eeb3 100644 --- a/other/apidsl/toxav.in.h +++ b/other/apidsl/toxav.in.h @@ -490,12 +490,12 @@ namespace video { * * @param friend_number The friend number of the friend for which to set the * video bit rate. - * @param audio_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable + * @param video_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable * video sending. * @param force True if the bit rate change is forceful. * */ - bool set(uint32_t friend_number, uint32_t audio_bit_rate, bool force) with error for set_bit_rate; + bool set(uint32_t friend_number, uint32_t video_bit_rate, bool force) with error for set_bit_rate; } } /******************************************************************************* diff --git a/testing/av_test.c b/testing/av_test.c index 20e00c12..8e048d02 100644 --- a/testing/av_test.c +++ b/testing/av_test.c @@ -91,7 +91,6 @@ struct toxav_thread_data { const char* vdout = "AV Test"; /* Video output */ PaStream* adout = NULL; /* Audio output */ - typedef struct { uint16_t size; int16_t data[]; @@ -118,7 +117,6 @@ void* pa_write_thread (void* d) } } - /** * Callbacks */ @@ -207,7 +205,6 @@ void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t } } - /** */ void initialize_tox(Tox** bootstrap, ToxAV** AliceAV, CallControl* AliceCC, ToxAV** BobAV, CallControl* BobCC) @@ -374,7 +371,6 @@ int send_opencv_img(ToxAV* av, uint32_t friend_number, const IplImage* img) free(planes[2]); return rc; } - int print_audio_devices() { int i = 0; @@ -386,7 +382,6 @@ int print_audio_devices() return 0; } - int print_help (const char* name) { printf("Usage: %s -[a:v:o:dh]\n" diff --git a/toxav/audio.c b/toxav/audio.c index 0a6f04e3..afb9f26c 100644 --- a/toxav/audio.c +++ b/toxav/audio.c @@ -117,6 +117,7 @@ void ac_kill(ACSession* ac) return; opus_encoder_destroy(ac->encoder); + opus_encoder_destroy(ac->test_encoder); opus_decoder_destroy(ac->decoder); jbuf_free(ac->j_buf); diff --git a/toxav/rtp.c b/toxav/rtp.c index 148c4238..7a20877f 100644 --- a/toxav/rtp.c +++ b/toxav/rtp.c @@ -138,7 +138,7 @@ void rtp_kill ( RTPSession *session ) { if ( !session ) return; - rtp_stop_receiving (session); + rtp_stop_receiving (session); free ( session->ext_header ); free ( session->csrc ); @@ -153,6 +153,7 @@ void rtp_kill ( RTPSession *session ) LOGGER_DEBUG("Terminated RTP session: %p", session); /* And finally free session */ + free ( session->rtcp_session ); free ( session ); } int rtp_do(RTPSession *session) diff --git a/toxav/toxav.h b/toxav/toxav.h index 3c745b36..58d5503f 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h @@ -510,12 +510,12 @@ void toxav_callback_video_bit_rate_status(ToxAV *toxAV, toxav_video_bit_rate_sta * * @param friend_number The friend number of the friend for which to set the * video bit rate. - * @param audio_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable + * @param video_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable * video sending. * @param force True if the bit rate change is forceful. * */ -bool toxav_video_bit_rate_set(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, bool force, TOXAV_ERR_SET_BIT_RATE *error); +bool toxav_video_bit_rate_set(ToxAV *toxAV, uint32_t friend_number, uint32_t video_bit_rate, bool force, TOXAV_ERR_SET_BIT_RATE *error); /******************************************************************************* * * :: A/V sending