summaryrefslogtreecommitdiff
path: root/toxav/codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxav/codec.c')
-rw-r--r--toxav/codec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/toxav/codec.c b/toxav/codec.c
index a5946b38..ed0c8e54 100644
--- a/toxav/codec.c
+++ b/toxav/codec.c
@@ -80,8 +80,12 @@ JitterBuffer *create_queue(int capacity)
80 80
81void terminate_queue(JitterBuffer *q) 81void terminate_queue(JitterBuffer *q)
82{ 82{
83 if (!q) return;
84
83 empty_queue(q); 85 empty_queue(q);
84 free(q->queue); 86 free(q->queue);
87
88 LOGGER_DEBUG("Terminated jitter buffer: %p", q);
85 free(q); 89 free(q);
86} 90}
87 91
@@ -355,6 +359,8 @@ CodecState *codec_init_session ( uint32_t audio_bitrate,
355 359
356void codec_terminate_session ( CodecState *cs ) 360void codec_terminate_session ( CodecState *cs )
357{ 361{
362 if (!cs) return;
363
358 if ( cs->audio_encoder ) 364 if ( cs->audio_encoder )
359 opus_encoder_destroy(cs->audio_encoder); 365 opus_encoder_destroy(cs->audio_encoder);
360 366
@@ -366,6 +372,9 @@ void codec_terminate_session ( CodecState *cs )
366 372
367 if ( cs->capabilities & v_encoding ) 373 if ( cs->capabilities & v_encoding )
368 vpx_codec_destroy(&cs->v_encoder); 374 vpx_codec_destroy(&cs->v_encoder);
375
376 LOGGER_DEBUG("Terminated codec state: %p", cs);
377 free(cs);
369} 378}
370 379
371inline float calculate_sum_sq (int16_t *n, uint16_t k) 380inline float calculate_sum_sq (int16_t *n, uint16_t k)