summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_oss.c')
-rw-r--r--audio/out/ao_oss.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c
index 556f3c25c9..db9847851d 100644
--- a/audio/out/ao_oss.c
+++ b/audio/out/ao_oss.c
@@ -508,16 +508,13 @@ static int play(struct ao *ao, void *data, int len, int flags)
static void audio_resume(struct ao *ao)
{
struct priv *p = ao->priv;
- int fillcnt;
#ifndef SNDCTL_DSP_RESET
reset(ao);
#endif
- fillcnt = get_space(ao) - p->prepause_space;
- if (fillcnt > 0 && !(ao->format & AF_FORMAT_SPECIAL_MASK)) {
- void *silence = calloc(fillcnt, 1);
- play(ao, silence, fillcnt, 0);
- free(silence);
- }
+ int fillframes = (get_space(ao) - p->prepause_space) /
+ (af_fmt2bits(ao->format) / 8 * ao->channels.num);
+ if (fillframes > 0)
+ ao_play_silence(ao, fillframes);
}
// return: delay in seconds between first and last sample in buffer