From: Andre Noll Date: Sat, 19 Sep 2009 08:08:59 +0000 (+0200) Subject: vss: Honor header chunk when computing FEC group start. X-Git-Tag: v0.3.5~1^2~7 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f21270523b4500797f7976906998128f5ff5da72;hp=c0876c7471af8dc8c677e8c98e58d2715b21929e vss: Honor header chunk when computing FEC group start. 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. --- diff --git a/vss.c b/vss.c index babcd24c..aae601d1 100644 --- a/vss.c +++ b/vss.c @@ -354,7 +354,12 @@ static int setup_next_fec_group(struct fec_client *fc, struct vss_task *vsst) 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; }