]> granicus.if.org Git - libvpx/commitdiff
Merge "guard against space/time distortion"
authorJohn Koleszar <jkoleszar@google.com>
Wed, 29 Jun 2011 18:36:51 +0000 (11:36 -0700)
committerCode Review <code-review@webmproject.org>
Wed, 29 Jun 2011 18:36:51 +0000 (11:36 -0700)
1  2 
vpxenc.c

diff --cc vpxenc.c
index 82f9071c4d19c974bbcab4bc35492bf2206c4957,775a22b2734136d867d7908a72894d91298227e0..042f07b81344993867598ace09dcfa0ba2c3c427
+++ b/vpxenc.c
@@@ -1347,8 -1342,10 +1347,10 @@@ static void update_rate_histogram(struc
      if(now < cfg->rc_buf_initial_sz)
          return;
  
+     then = now;
      /* Sum the size over the past rc_buf_sz ms */
 -    for(i = hist->frames; i > 0; i--)
 +    for(i = hist->frames; i > 0 && hist->frames - i < hist->samples; i--)
      {
          int i_idx = (i-1) % hist->samples;