]> git.tuebingen.mpg.de Git - paraslash.git/commit
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)
commit3f9051d22fcf6e968259946eaf521ac3daac470e
treed131f69a20608ff45302643f8abb38d1b63f7847
parentc630fae7b18ec399c45305737f10ab47733dc63e
vss: Fix computation of extra slices.

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.
udp_send.c
vss.c