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

Fix handling of holes.

We have to call op_collect_audio_packets() again to drain any
 buffered packets from the page.
parent 9391feca
...@@ -1801,8 +1801,13 @@ static int op_fetch_and_process_page(OggOpusFile *_of, ...@@ -1801,8 +1801,13 @@ static int op_fetch_and_process_page(OggOpusFile *_of,
int durations[255]; int durations[255];
int op_count; int op_count;
total_duration=op_collect_audio_packets(_of,durations); total_duration=op_collect_audio_packets(_of,durations);
/*Report holes to the caller.*/ if(OP_UNLIKELY(total_duration<0)){
if(OP_UNLIKELY(total_duration<0)&&!_ignore_holes)return OP_HOLE; /*Drain the packets from the page anyway.*/
total_duration=op_collect_audio_packets(_of,durations);
OP_ASSERT(total_duration>=0);
/*Report holes to the caller.*/
if(!_ignore_holes)return OP_HOLE;
}
op_count=_of->op_count; op_count=_of->op_count;
/*If we found at least one audio data packet, compute per-packet granule /*If we found at least one audio data packet, compute per-packet granule
positions for them.*/ positions for them.*/
......
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