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.
This commit is contained in:
wm4 2017-07-21 19:45:59 +02:00
parent f676f6d2b9
commit 8c82555e41
1 changed files with 3 additions and 2 deletions

View File

@ -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;