audio: stop corrupting audio on underreads

regression introduced in b74c09efbf

Signed-off-by: Aman Karmani <aman@tmm1.net>
This commit is contained in:
Aman Karmani 2021-11-19 08:53:58 -08:00 committed by Aman Gupta Karmani
parent 970061efdc
commit ac3d567bd3
1 changed files with 2 additions and 1 deletions

View File

@ -162,7 +162,8 @@ static int read_buffer(struct ao *ao, void **data, int samples, bool *eof)
// pad with silence (underflow/paused/eof)
for (int n = 0; n < ao->num_planes; n++) {
af_fill_silence((char *)data[n] + pos, (samples - pos) * ao->sstride,
af_fill_silence((char *)data[n] + pos * ao->sstride,
(samples - pos) * ao->sstride,
ao->format);
}