diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-08-07 02:04:04 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-08-07 02:04:04 +0200 |
commit | 657a57b406717a3ff08233eef14f20818c137f47 (patch) | |
tree | ac0bcda6a036825796d29ef4b5538045233bd082 | |
parent | 7d5de68364f83662a19e45e6e3ab021414178df5 (diff) |
Fixed memory leak during session cleanup and fixed naming.
-rw-r--r-- | other/apidsl/toxav.in.h | 4 | ||||
-rw-r--r-- | testing/av_test.c | 5 | ||||
-rw-r--r-- | toxav/audio.c | 1 | ||||
-rw-r--r-- | toxav/rtp.c | 3 | ||||
-rw-r--r-- | 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 { | |||
490 | * | 490 | * |
491 | * @param friend_number The friend number of the friend for which to set the | 491 | * @param friend_number The friend number of the friend for which to set the |
492 | * video bit rate. | 492 | * video bit rate. |
493 | * @param audio_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable | 493 | * @param video_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable |
494 | * video sending. | 494 | * video sending. |
495 | * @param force True if the bit rate change is forceful. | 495 | * @param force True if the bit rate change is forceful. |
496 | * | 496 | * |
497 | */ | 497 | */ |
498 | bool set(uint32_t friend_number, uint32_t audio_bit_rate, bool force) with error for set_bit_rate; | 498 | bool set(uint32_t friend_number, uint32_t video_bit_rate, bool force) with error for set_bit_rate; |
499 | } | 499 | } |
500 | } | 500 | } |
501 | /******************************************************************************* | 501 | /******************************************************************************* |
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 { | |||
91 | const char* vdout = "AV Test"; /* Video output */ | 91 | const char* vdout = "AV Test"; /* Video output */ |
92 | PaStream* adout = NULL; /* Audio output */ | 92 | PaStream* adout = NULL; /* Audio output */ |
93 | 93 | ||
94 | |||
95 | typedef struct { | 94 | typedef struct { |
96 | uint16_t size; | 95 | uint16_t size; |
97 | int16_t data[]; | 96 | int16_t data[]; |
@@ -118,7 +117,6 @@ void* pa_write_thread (void* d) | |||
118 | } | 117 | } |
119 | } | 118 | } |
120 | 119 | ||
121 | |||
122 | /** | 120 | /** |
123 | * Callbacks | 121 | * Callbacks |
124 | */ | 122 | */ |
@@ -207,7 +205,6 @@ void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t | |||
207 | } | 205 | } |
208 | } | 206 | } |
209 | 207 | ||
210 | |||
211 | /** | 208 | /** |
212 | */ | 209 | */ |
213 | void initialize_tox(Tox** bootstrap, ToxAV** AliceAV, CallControl* AliceCC, ToxAV** BobAV, CallControl* BobCC) | 210 | 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) | |||
374 | free(planes[2]); | 371 | free(planes[2]); |
375 | return rc; | 372 | return rc; |
376 | } | 373 | } |
377 | |||
378 | int print_audio_devices() | 374 | int print_audio_devices() |
379 | { | 375 | { |
380 | int i = 0; | 376 | int i = 0; |
@@ -386,7 +382,6 @@ int print_audio_devices() | |||
386 | 382 | ||
387 | return 0; | 383 | return 0; |
388 | } | 384 | } |
389 | |||
390 | int print_help (const char* name) | 385 | int print_help (const char* name) |
391 | { | 386 | { |
392 | printf("Usage: %s -[a:v:o:dh]\n" | 387 | 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) | |||
117 | return; | 117 | return; |
118 | 118 | ||
119 | opus_encoder_destroy(ac->encoder); | 119 | opus_encoder_destroy(ac->encoder); |
120 | opus_encoder_destroy(ac->test_encoder); | ||
120 | opus_decoder_destroy(ac->decoder); | 121 | opus_decoder_destroy(ac->decoder); |
121 | jbuf_free(ac->j_buf); | 122 | jbuf_free(ac->j_buf); |
122 | 123 | ||
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 ) | |||
138 | { | 138 | { |
139 | if ( !session ) return; | 139 | if ( !session ) return; |
140 | 140 | ||
141 | rtp_stop_receiving (session); | 141 | rtp_stop_receiving (session); |
142 | 142 | ||
143 | free ( session->ext_header ); | 143 | free ( session->ext_header ); |
144 | free ( session->csrc ); | 144 | free ( session->csrc ); |
@@ -153,6 +153,7 @@ void rtp_kill ( RTPSession *session ) | |||
153 | LOGGER_DEBUG("Terminated RTP session: %p", session); | 153 | LOGGER_DEBUG("Terminated RTP session: %p", session); |
154 | 154 | ||
155 | /* And finally free session */ | 155 | /* And finally free session */ |
156 | free ( session->rtcp_session ); | ||
156 | free ( session ); | 157 | free ( session ); |
157 | } | 158 | } |
158 | int rtp_do(RTPSession *session) | 159 | 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 | |||
510 | * | 510 | * |
511 | * @param friend_number The friend number of the friend for which to set the | 511 | * @param friend_number The friend number of the friend for which to set the |
512 | * video bit rate. | 512 | * video bit rate. |
513 | * @param audio_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable | 513 | * @param video_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable |
514 | * video sending. | 514 | * video sending. |
515 | * @param force True if the bit rate change is forceful. | 515 | * @param force True if the bit rate change is forceful. |
516 | * | 516 | * |
517 | */ | 517 | */ |
518 | 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); | 518 | 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); |
519 | /******************************************************************************* | 519 | /******************************************************************************* |
520 | * | 520 | * |
521 | * :: A/V sending | 521 | * :: A/V sending |