From 8c82555e41a6a9edb677756cfe89f28a2918be2a Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 21 Jul 2017 19:45:59 +0200 Subject: ao_oss: fix a dumb calculation period_size used the wrong unit, and even if the unit had been correct, was assigned the wrong value. Probably fixes #4642. --- audio/out/ao_oss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index 06f7b3cad5..eebd9622e7 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -387,8 +387,9 @@ static int reopen_device(struct ao *ao, bool allow_format_changes) } } - ao->period_size = channels.num * af_fmt_to_bytes(format); - p->outburst -= p->outburst % ao->period_size; // round down + int sstride = channels.num * af_fmt_to_bytes(format); + p->outburst -= p->outburst % sstride; // round down + ao->period_size = p->outburst / sstride; return 0; -- cgit v1.2.3