diff options
author | wm4 <wm4@nowhere> | 2014-09-06 12:59:00 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-06 12:59:00 +0200 |
commit | 769ac6fb7bb39cb04933e1dede32cdbec4f74098 (patch) | |
tree | 0afa5a9dc8591c105d19b7a72800fce1a3ae37dd /audio/out/ao_sndio.c | |
parent | d9941e01ccafd5fc3fc87581dcbae5cacfa8f171 (diff) | |
download | mpv-769ac6fb7bb39cb04933e1dede32cdbec4f74098.tar.bz2 mpv-769ac6fb7bb39cb04933e1dede32cdbec4f74098.tar.xz |
audio/out: always round get_space on period size
Round get_space() results in the same way play() rounds the input size.
Some audio APIs do this for various reasons.
This affects only "push" based AOs. Some of these need no change,
because they either do it already right (like ao_openal), or they seem
not to have any such requirements (like ao_pulse).
Needed for the following commit.
Diffstat (limited to 'audio/out/ao_sndio.c')
-rw-r--r-- | audio/out/ao_sndio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/out/ao_sndio.c b/audio/out/ao_sndio.c index 457da588a1..c75027dffc 100644 --- a/audio/out/ao_sndio.c +++ b/audio/out/ao_sndio.c @@ -273,7 +273,8 @@ static int get_space(struct ao *ao) ; /* nothing */ sio_revents(p->hdl, p->pfd); - return (p->par.bufsz * p->par.pchan * p->par.bps - p->delay) / ao->sstride; + int samples = (p->par.bufsz * p->par.pchan * p->par.bps - p->delay) / ao->sstride; + return samples / p->par.round * p->par.round; } /* |