From da6c17222f54c933c826e9c557e66629ee57790f Mon Sep 17 00:00:00 2001 From: mannol Date: Thu, 16 Apr 2015 02:00:34 +0200 Subject: The pretty basic adaptive bitrate is *working* --- toxav/codec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'toxav/codec.c') 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) /* The maximum for 120 ms 48 KHz audio */ int16_t tmp[5760]; - while ((msg = jbuf_read(cs->j_buf, &success)) || success == 2) { + if ((msg = jbuf_read(cs->j_buf, &success)) || success == 2) { LOGGED_UNLOCK(cs->queue_mutex); if (success == 2) { @@ -327,7 +327,7 @@ void cs_do(CSession *cs) if (!reconfigure_audio_decoder(cs, cs->last_packet_sampling_rate, cs->last_packet_channel_count)) { LOGGER_WARNING("Failed to reconfigure decoder!"); rtp_free_msg(NULL, msg); - continue; + goto DONE; } rc = opus_decode(cs->audio_decoder, msg->data + 4, msg->length - 4, tmp, 5760, 0); @@ -347,6 +347,7 @@ void cs_do(CSession *cs) LOGGED_LOCK(cs->queue_mutex); } + DONE:; } /********************* VIDEO *********************/ -- cgit v1.2.3