From eb65860720854c2a1136ba62ecac35fa8d638e84 Mon Sep 17 00:00:00 2001 From: "stefan@webrtc.org" Date: Fri, 28 Oct 2011 12:25:34 +0000 Subject: [PATCH] Reverts the workaround in r823 and solves a macro bug. The macro bug caused frames to be dropped after being grabbed for decoding. BUG= TEST= Review URL: http://webrtc-codereview.appspot.com/248004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@831 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/video_coding/main/source/internal_defines.h | 4 ++-- src/modules/video_coding/main/source/receiver.cc | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/video_coding/main/source/internal_defines.h b/src/modules/video_coding/main/source/internal_defines.h index 781e668f18..4c3c997105 100644 --- a/src/modules/video_coding/main/source/internal_defines.h +++ b/src/modules/video_coding/main/source/internal_defines.h @@ -23,8 +23,8 @@ inline WebRtc_UWord32 MaskWord64ToUWord32(WebRtc_Word64 w64) return static_cast(MASK_32_BITS(w64)); } -#define VCM_MAX(a, b) ((a) > (b)) ? (a) : (b) -#define VCM_MIN(a, b) ((a) < (b)) ? (a) : (b) +#define VCM_MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define VCM_MIN(a, b) (((a) < (b)) ? (a) : (b)) #define VCM_DEFAULT_CODEC_WIDTH 352 #define VCM_DEFAULT_CODEC_HEIGHT 288 diff --git a/src/modules/video_coding/main/source/receiver.cc b/src/modules/video_coding/main/source/receiver.cc index 0884abd61e..10227f053f 100644 --- a/src/modules/video_coding/main/source/receiver.cc +++ b/src/modules/video_coding/main/source/receiver.cc @@ -254,6 +254,12 @@ VCMReceiver::FrameForDecoding(WebRtc_UWord16 maxWaitTimeMs, return NULL; } + if (frame == NULL && VCM_MIN(waitTimeMs, maxWaitTimeMs) == 0) + { + // No time to wait for a complete frame, + // check if we have an incomplete + frame = _jitterBuffer.GetFrameForDecoding(); + } if (frame == NULL) { // Wait for a complete frame