diff options
author | wm4 <wm4@nowhere> | 2017-07-21 19:45:59 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-07-21 19:45:59 +0200 |
commit | 8c82555e41a6a9edb677756cfe89f28a2918be2a (patch) | |
tree | 7b16ebc17a0d119f1d7d23f6b8aaea07c12a5c0d | |
parent | f676f6d2b90f26106f8aadc31ff6ea2d89225deb (diff) | |
download | mpv-8c82555e41a6a9edb677756cfe89f28a2918be2a.tar.bz2 mpv-8c82555e41a6a9edb677756cfe89f28a2918be2a.tar.xz |
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.
-rw-r--r-- | audio/out/ao_oss.c | 5 |
1 files 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; |