From 72858076f54da1b94739a79d3be9ee6434d785ce Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 12 Jul 2014 23:24:47 -0400 Subject: [PATCH] Set a deadline in the vpx video decoder to try to solve issues on slow hardware. --- toxav/toxav.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toxav/toxav.c b/toxav/toxav.c index a301e007..aa903ff7 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -37,8 +37,9 @@ #include #include -/* Assume 60 fps*/ +/* Assume 24 fps*/ #define MAX_ENCODE_TIME_US ((1000 / 24) * 1000) +#define MAX_DECODE_TIME_US MAX_ENCODE_TIME_US #define MAX_VIDEOFRAME_SIZE 0x40000 /* 256KiB */ #define VIDEOFRAME_PIECE_SIZE 0x500 /* 1.25 KiB*/ @@ -794,7 +795,7 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg) /* piece of current frame */ } else if (i > 0 && i < 128) { /* recieved a piece of a frame ahead, flush current frame and start reading this new frame */ - int rc = vpx_codec_decode(&call->cs->v_decoder, call->frame_buf, call->frame_limit, NULL, 0); + int rc = vpx_codec_decode(&call->cs->v_decoder, call->frame_buf, call->frame_limit, NULL, MAX_DECODE_TIME_US); call->frame_id = packet[0]; memset(call->frame_buf, 0, call->frame_limit); call->frame_limit = 0;