diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-03-22 23:50:43 +0100 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-03-22 23:50:43 +0100 |
commit | 62af82705a805648a4dba54a7f516681e5163923 (patch) | |
tree | f417e3489ed834de9df60cb7b4bbec625482638c /toxav/codec.c | |
parent | a4fae8ffd49e298cd87e13be2496faf77e492bd9 (diff) |
Some progress
Diffstat (limited to 'toxav/codec.c')
-rw-r--r-- | toxav/codec.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/toxav/codec.c b/toxav/codec.c index bf94115e..80975b70 100644 --- a/toxav/codec.c +++ b/toxav/codec.c | |||
@@ -245,7 +245,7 @@ void cs_do(CSSession *cs) | |||
245 | /* Codec session should always be protected by call mutex so no need to check for cs validity | 245 | /* Codec session should always be protected by call mutex so no need to check for cs validity |
246 | */ | 246 | */ |
247 | 247 | ||
248 | if (!cs) | 248 | if (!cs) |
249 | return; | 249 | return; |
250 | 250 | ||
251 | Payload *p; | 251 | Payload *p; |
@@ -258,7 +258,7 @@ void cs_do(CSSession *cs) | |||
258 | if (cs->audio_decoder) { /* If receiving enabled */ | 258 | if (cs->audio_decoder) { /* If receiving enabled */ |
259 | RTPMessage *msg; | 259 | RTPMessage *msg; |
260 | 260 | ||
261 | uint16_t fsize = 5760; /* Max frame size for 48 kHz */ | 261 | uint16_t fsize = 16000; /* Max frame size for 48 kHz */ |
262 | int16_t tmp[fsize * 2]; | 262 | int16_t tmp[fsize * 2]; |
263 | 263 | ||
264 | while ((msg = jbuf_read(cs->j_buf, &success)) || success == 2) { | 264 | while ((msg = jbuf_read(cs->j_buf, &success)) || success == 2) { |
@@ -284,6 +284,7 @@ void cs_do(CSSession *cs) | |||
284 | continue; | 284 | continue; |
285 | } | 285 | } |
286 | 286 | ||
287 | LOGGER_DEBUG("Decoding packet of length: %d", msg->length); | ||
287 | rc = opus_decode(cs->audio_decoder, msg->data, msg->length, tmp, fsize, 0); | 288 | rc = opus_decode(cs->audio_decoder, msg->data, msg->length, tmp, fsize, 0); |
288 | rtp_free_msg(NULL, msg); | 289 | rtp_free_msg(NULL, msg); |
289 | } | 290 | } |
@@ -741,8 +742,9 @@ void queue_message(RTPSession *session, RTPMessage *msg) | |||
741 | */ | 742 | */ |
742 | CSSession *cs = session->cs; | 743 | CSSession *cs = session->cs; |
743 | 744 | ||
744 | if (!cs) return; | 745 | if (!cs) |
745 | 746 | return; | |
747 | |||
746 | /* Audio */ | 748 | /* Audio */ |
747 | if (session->payload_type == rtp_TypeAudio % 128) { | 749 | if (session->payload_type == rtp_TypeAudio % 128) { |
748 | pthread_mutex_lock(cs->queue_mutex); | 750 | pthread_mutex_lock(cs->queue_mutex); |