The first chunk of an ogg vorbis file is the audio file header
which should not be included in the calculation of the FEC
group timing.
g->num_header_slices, data_slices
);
/* set group start */
- tv_scale(g->first_chunk - fc->first_stream_chunk, chunk_tv, &tmp);
+ if (g->num != 0 && vsst->header_len != 0 && fc->first_stream_chunk == 0)
+ /* chunk #0 is the audio file header */
+ tv_scale(g->first_chunk - 1, chunk_tv, &tmp);
+ else
+ tv_scale(g->first_chunk - fc->first_stream_chunk,
+ chunk_tv, &tmp);
tv_add(&fc->stream_start, &tmp, &g->start);
return 1;
}