From 2dcbcc147ba8df139545d8a8a8d65899edca9a2f Mon Sep 17 00:00:00 2001 From: "stefan@webrtc.org" Date: Mon, 24 Sep 2012 15:13:30 +0000 Subject: [PATCH] Changing two asserts which should have returned errors instead. BUG= Review URL: https://webrtc-codereview.appspot.com/827007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2810 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/video_engine/stream_synchronization.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/video_engine/stream_synchronization.cc b/src/video_engine/stream_synchronization.cc index fedea4ad3..a905c4c50 100644 --- a/src/video_engine/stream_synchronization.cc +++ b/src/video_engine/stream_synchronization.cc @@ -41,10 +41,9 @@ bool CalculateFrequency( int64_t rtcp_ntp_ms2, uint32_t rtp_timestamp2, double* frequency_khz) { - if (rtcp_ntp_ms1 == rtcp_ntp_ms2) { + if (rtcp_ntp_ms1 <= rtcp_ntp_ms2) { return false; } - assert(rtcp_ntp_ms1 > rtcp_ntp_ms2); *frequency_khz = static_cast(rtp_timestamp1 - rtp_timestamp2) / static_cast(rtcp_ntp_ms1 - rtcp_ntp_ms2); return true; @@ -107,7 +106,9 @@ bool RtpToNtpMs(int64_t rtp_timestamp, } double rtp_timestamp_ntp_ms = (static_cast(rtp_timestamp_unwrapped) - offset) / freq_khz + 0.5f; - assert(rtp_timestamp_ntp_ms >= 0); + if (rtp_timestamp_ntp_ms < 0) { + return false; + } *rtp_timestamp_in_ms = rtp_timestamp_ntp_ms; return true; }