summaryrefslogtreecommitdiff
path: root/toxav/codec.c
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-04-16 02:00:34 +0200
committermannol <eniz_vukovic@hotmail.com>2015-04-16 02:00:34 +0200
commitda6c17222f54c933c826e9c557e66629ee57790f (patch)
tree2cf5e0ff002bef5d69f0048475ea7becc11bd389 /toxav/codec.c
parent2465f486acd90ed8395c8a83a13af09ecd024c98 (diff)
The pretty basic adaptive bitrate is *working*
Diffstat (limited to 'toxav/codec.c')
-rw-r--r--toxav/codec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toxav/codec.c b/toxav/codec.c
index 671be1ac..1e8754e9 100644
--- a/toxav/codec.c
+++ b/toxav/codec.c
@@ -293,7 +293,7 @@ void cs_do(CSession *cs)
293 /* The maximum for 120 ms 48 KHz audio */ 293 /* The maximum for 120 ms 48 KHz audio */
294 int16_t tmp[5760]; 294 int16_t tmp[5760];
295 295
296 while ((msg = jbuf_read(cs->j_buf, &success)) || success == 2) { 296 if ((msg = jbuf_read(cs->j_buf, &success)) || success == 2) {
297 LOGGED_UNLOCK(cs->queue_mutex); 297 LOGGED_UNLOCK(cs->queue_mutex);
298 298
299 if (success == 2) { 299 if (success == 2) {
@@ -327,7 +327,7 @@ void cs_do(CSession *cs)
327 if (!reconfigure_audio_decoder(cs, cs->last_packet_sampling_rate, cs->last_packet_channel_count)) { 327 if (!reconfigure_audio_decoder(cs, cs->last_packet_sampling_rate, cs->last_packet_channel_count)) {
328 LOGGER_WARNING("Failed to reconfigure decoder!"); 328 LOGGER_WARNING("Failed to reconfigure decoder!");
329 rtp_free_msg(NULL, msg); 329 rtp_free_msg(NULL, msg);
330 continue; 330 goto DONE;
331 } 331 }
332 332
333 rc = opus_decode(cs->audio_decoder, msg->data + 4, msg->length - 4, tmp, 5760, 0); 333 rc = opus_decode(cs->audio_decoder, msg->data + 4, msg->length - 4, tmp, 5760, 0);
@@ -347,6 +347,7 @@ void cs_do(CSession *cs)
347 347
348 LOGGED_LOCK(cs->queue_mutex); 348 LOGGED_LOCK(cs->queue_mutex);
349 } 349 }
350 DONE:;
350 } 351 }
351 352
352 /********************* VIDEO *********************/ 353 /********************* VIDEO *********************/