media/liboggz/bug520493.patch
author Timothy Nikkel <tnikkel@gmail.com>
Thu, 18 Feb 2010 13:23:23 -0600
changeset 38273 5b74da35092c9cd5d8c942adc89c47fa9dc86d45
parent 33825 4769862ade7f228613d64d9df1d716e196eba1bd
permissions -rw-r--r--
Bug 545593. Remove nsViewManager::Enable/DisableRefresh. r=roc

diff --git a/media/liboggz/src/liboggz/oggz_seek.c b/media/liboggz/src/liboggz/oggz_seek.c
--- a/media/liboggz/src/liboggz/oggz_seek.c
+++ b/media/liboggz/src/liboggz/oggz_seek.c
@@ -762,40 +762,36 @@ oggz_bounded_seek_set (OGGZ * oggz,
 
     if (abs(unit_at - unit_target) < fuzz_margin) {
       // Within fuzz_margin of target, stop.
       break;
     }
 
 #ifdef DEBUG
     printf ("oggz_bounded_seek_set: offset_next %" PRI_OGGZ_OFF_T "d\n", offset_next);
-#endif
-    if (unit_at == unit_last_iter) break;
-
-#ifdef DEBUG
     printf ("oggz_bounded_seek_set: [D] want u%lld, got page u%lld @%" PRI_OGGZ_OFF_T "d g%lld\n",
 	    unit_target, unit_at, offset_at, granule_at);
 #endif
 
     if (unit_at < unit_target) {
-      offset_begin = offset_at;
+      offset_begin = offset_next;
       unit_begin = unit_at;
       if (unit_end == unit_begin) break;
     } else if (unit_at > unit_target) {
       offset_end = offset_at-1;
       unit_end = unit_at;
       if (unit_end == unit_begin) break;
     } else {
       break;
     }
   }
 
    /* Reader is now approximately at the seek target. */
 
-  offset_at = oggz_reset (oggz, offset_at, unit_at, SEEK_SET);
+  offset_at = oggz_reset (oggz, offset_next, unit_at, SEEK_SET);
   if (offset_at == -1)
     return -1;
 
   return (long)reader->current_unit;
 }
 
 static ogg_int64_t
 oggz_seek_end (OGGZ * oggz, ogg_int64_t unit_offset)