]> git.tuebingen.mpg.de Git - paraslash.git/commit
wng: Avoid buffer underruns due to filter chain output buffer constraints.
authorAndre Noll <maan@systemlinux.org>
Thu, 5 Nov 2009 21:42:52 +0000 (22:42 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 5 Nov 2009 21:42:52 +0000 (22:42 +0100)
commit2ce63f32adf9c47d6ed9604f3cd090229409df05
treed4f379353d1d4538b63f54daac94183024cd3077
parent079e0d3d2c271d7f84f79ae71f0be813c6438c8c
wng: Avoid buffer underruns due to filter chain output buffer constraints.

Using ogg vorbis streams together with the oss writer hits the following nasty bug:
In case the filter chain can provide more data than what fits into its output buffer,
it converts the maximal amount possible to completely fill its output buffer. However, the
time to play this data might be less than than the time until the next data packet arrives
from the upper layers, especially when using ogg vorbis streams and FEC.

Since the filter chain task has no pre_select function,  the convert function(s) of its filter
nodes only get the chance to convert more data until the next select call returns, which
might already be too late.

This patch fixes the bug by teaching the pre_select function of the writer node group
to  remember whether something was written during the previous call  to wng_post_select().
In this case we force a minimal timeout for select, i.e. the next call to select() will return
immediately and the convert functions of the filter node are called again, hopefully converting
more data for the writer node group.
write.h
write_common.c