Commit 33d17971 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Fix timestamp check for seek-free seek.

We avoid seeking when the seek target lies within the packets
 buffered from the current page.
However, the calculation of the page start time was _adding_ the
 first packet's duration to its end time, instead of subtracting
 it.
parent 872188c1
...@@ -2263,7 +2263,7 @@ static int op_pcm_seek_page(OggOpusFile *_of, ...@@ -2263,7 +2263,7 @@ static int op_pcm_seek_page(OggOpusFile *_of,
generally 1 second or less), we can loop them continuously generally 1 second or less), we can loop them continuously
without seeking at all.*/ without seeking at all.*/
OP_ALWAYS_TRUE(!op_granpos_add(&prev_page_gp,_of->op[0].granulepos, OP_ALWAYS_TRUE(!op_granpos_add(&prev_page_gp,_of->op[0].granulepos,
op_get_packet_duration(_of->op[0].packet,_of->op[0].bytes))); -op_get_packet_duration(_of->op[0].packet,_of->op[0].bytes)));
if(op_granpos_cmp(prev_page_gp,_target_gp)<=0){ if(op_granpos_cmp(prev_page_gp,_target_gp)<=0){
/*Don't call op_decode_clear(), because it will dump our /*Don't call op_decode_clear(), because it will dump our
packets.*/ packets.*/
......
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