2009-06-03 19:06:03 -07:00
|
|
|
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
|
2009-09-15 20:45:16 -07:00
|
|
|
@@ -472,16 +472,18 @@ oggz_scan_for_page (OGGZ * oggz, ogg_pag
|
2009-06-03 19:06:03 -07:00
|
|
|
serialno = ogg_page_serialno (og);
|
|
|
|
granule_at = ogg_page_granulepos (og);
|
|
|
|
unit_at = oggz_get_unit (oggz, serialno, granule_at);
|
|
|
|
|
|
|
|
break;
|
|
|
|
#else
|
|
|
|
do {
|
|
|
|
offset_at = oggz_get_prev_start_page(oggz, og, &granule_at, &serialno);
|
|
|
|
+ if (offset_at < 0)
|
|
|
|
+ break;
|
|
|
|
unit_at = oggz_get_unit(oggz, serialno, granule_at);
|
|
|
|
} while (unit_at > unit_target);
|
|
|
|
return offset_at;
|
|
|
|
#endif
|
|
|
|
} else if (unit_at == unit_target) {
|
|
|
|
#ifdef DEBUG
|
|
|
|
printf (" scan: (%lld) == (%lld)\n", unit_at, unit_target);
|
|
|
|
#endif
|
2009-09-15 20:45:16 -07:00
|
|
|
@@ -761,16 +763,18 @@ oggz_bounded_seek_set (OGGZ * oggz,
|
2009-06-03 19:06:03 -07:00
|
|
|
if (unit_end == unit_begin) break;
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
|
|
|
offset_at = oggz_get_prev_start_page (oggz, og, &granule_at, &serialno);
|
|
|
|
+ if (offset_at < 0)
|
|
|
|
+ break;
|
|
|
|
unit_at = oggz_get_unit (oggz, serialno, granule_at);
|
|
|
|
} while (unit_at > unit_target);
|
|
|
|
|
|
|
|
if (offset_at < 0) {
|
|
|
|
oggz_reset (oggz, offset_orig, -1, SEEK_SET);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|