From bc5eafac208f00b32d384d2b9c566f3f1ae4c534 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Mon, 30 Jun 2014 15:41:52 -0400 Subject: Fixed video in call sometimes freezing. This should not happen anymore. --- toxav/toxav.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'toxav/toxav.c') diff --git a/toxav/toxav.c b/toxav/toxav.c index ad8e651f..3085827c 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -422,7 +422,7 @@ inline__ int toxav_send_rtp_payload ( ToxAv *av, int32_t call_index, ToxAvCallTy /* number of pieces - 1*/ uint8_t numparts = (length - 1) / VIDEOFRAME_PIECE_SIZE; - uint8_t load[3 + VIDEOFRAME_PIECE_SIZE]; + uint8_t load[2 + VIDEOFRAME_PIECE_SIZE]; load[0] = av->calls[call_index].frame_outid++; load[1] = 0; @@ -542,11 +542,11 @@ inline__ int toxav_recv_video ( ToxAv *av, int32_t call_index, vpx_image_t **out call->frame_limit = 0; if (rc != VPX_CODEC_OK) { - LOGGER_ERROR("Error decoding video: %s\n", vpx_codec_err_to_string(rc)); - return ErrorInternal; + LOGGER_ERROR("Error decoding video: %u %s\n", i, vpx_codec_err_to_string(rc)); } } else { /* old packet, dont read */ + LOGGER_DEBUG("Old packet: %u\n", i); continue; } @@ -556,12 +556,14 @@ inline__ int toxav_recv_video ( ToxAv *av, int32_t call_index, vpx_image_t **out continue; } + LOGGER_DEBUG("Video Packet: %u %u\n", packet[0], packet[1]); memcpy(call->frame_buf + packet[1] * VIDEOFRAME_PIECE_SIZE, packet + VIDEOFRAME_HEADER_SIZE, recved_size - VIDEOFRAME_HEADER_SIZE); uint32_t limit = packet[1] * VIDEOFRAME_PIECE_SIZE + recved_size - VIDEOFRAME_HEADER_SIZE; if (limit > call->frame_limit) { call->frame_limit = limit; + LOGGER_DEBUG("Limit: %u\n", call->frame_limit); } } -- cgit v1.2.3