]> code.delx.au - pulseaudio/commit
sink-input: Fix underrun_for calculation when resampling.
authorUoti Urpala <uau@glyph.nonexistent.invalid>
Sat, 28 Jul 2012 15:24:30 +0000 (18:24 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Thu, 30 Aug 2012 09:00:35 +0000 (12:00 +0300)
commit6031546f6660e06e05d0b40a4dbc0c8769eb10a6
tree5a5cb12adef7deb106aa85eb3c572332d570fee7
parent34ab73b9ac51ba865d299fe2c3c2916e867e94f4
sink-input: Fix underrun_for calculation when resampling.

pa_sink_input_seek() calculates output lenth (slength) and
corresponding input length (ilength). During an underrun, the function
generates slength bytes of silence and adds ilength to the
underrun_for value. However, the ilength value may be shortened to
match resampler limits, and there's no corresponding adjustment to
slength. Thus, the length of the generated silence is longer than
resampler output would have been, and underrun_for should be increased
by more than the limited ilength. This error makes the user-visible
since_underrun field in struct pa_timing_info too small. Fix by using
the original value calculated before limiting in this case.
src/pulsecore/sink-input.c