Commit f02dcbfe authored by conrad's avatar conrad

seek target estimation in oggz_read made to handle initial guesses beyond EOF


git-svn-id: http://svn.annodex.net/liboggz/trunk@577 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 49511b3e
......@@ -996,7 +996,7 @@ oggz_seek_set (OGGZ * oggz, ogg_int64_t unit_target)
(unit_at - unit_begin);
#ifdef DEBUG
printf ("\nguess_ratio %ld = (%ld - %ld) / (%ld - %ld)\n",
printf ("\nseek_set: guess_ratio %lld = (%lld - %lld) / (%lld - %lld)\n",
guess_ratio, unit_target, unit_begin, unit_at, unit_begin);
#endif
......@@ -1044,6 +1044,11 @@ oggz_seek_set (OGGZ * oggz, ogg_int64_t unit_target)
printf ("\n");
#endif
if (unit_end == -1 && offset_next == -2) { /* reached eof, backtrack */
offset_next = oggz_get_prev_start_page (oggz, og, &granule_at,
&serialno);
}
if (offset_next < 0) {
goto notfound;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment