summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_oss.c5
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;