]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
vss: Fix computation of extra slices.
authorAndre Noll <maan@systemlinux.org>
Sat, 24 Oct 2009 19:03:06 +0000 (21:03 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 24 Oct 2009 19:03:06 +0000 (21:03 +0200)
On stream start we check in setup_next_fec_group() whether the FEC
parameters requested by the client are sufficient for the current audio
file. We want each FEC group contain at least one non-header slice.

Since header slices can not contain any non-header data, the number
of required slices is given by the number of slices needed for the
header plus the number of slices needed for the largest chunk of the
audio file.

The current code gets this wrong because it computes the number of
slices needed for the header plus the largest chunk, which may be
strictly less than what is actually needed. IOW, the inequality

  num_slices(header + chunk) <= num_slices(header) + num_slices(chunk)

may be strict.

This bug could trigger the assertion assert(g->num_chunks) further
down in setup_next_fec_group().

This patch fixes this bug and also changes a log message in
udp_init_session() which always printed the requested FEC parameters,
not considering extra slices.


No differences found