ref: 1de99a2a81da913f9a03433a680be72c229362c1
parent: cfaee9f7c663150d4bc478bb47e3eb4038076ca5
author: Mikhal Shemer <mikhal@google.com>
date: Tue Mar 1 09:59:22 EST 2011
Fixing divide by zero Change-Id: I9d8a98a2f7ed1e3116d0bae35164618c41998bac
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -5214,9 +5214,12 @@
{
long long nanosecs = cpi->source_end_time_stamp
- cpi->last_end_time_stamp_seen;
- double this_fps = 10000000.000 / nanosecs;
- vp8_new_frame_rate(cpi, (7 * cpi->oxcf.frame_rate + this_fps) / 8);
+ if (nanosecs > 0)
+ {
+ double this_fps = 10000000.000 / nanosecs;
+ vp8_new_frame_rate(cpi, (7 * cpi->oxcf.frame_rate + this_fps) / 8);
+ }
}