From 3cb4116243e54b0452d88c70a7acd4af17cf8d02 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 10 Nov 2013 23:05:51 +0100 Subject: ao: add ao_play_silence, use for ao_alsa and ao_oss Also add a corresponding function to audio/format.c, which fills an audio block with silence. --- audio/format.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'audio/format.c') diff --git a/audio/format.c b/audio/format.c index b933d07e16..448b670671 100644 --- a/audio/format.c +++ b/audio/format.c @@ -127,3 +127,9 @@ int af_str2fmt_short(bstr str) } return 0; } + +void af_fill_silence(void *dst, size_t bytes, int format) +{ + bool us = (format & AF_FORMAT_SIGN_MASK) == AF_FORMAT_US; + memset(dst, us ? 0x80 : 0, bytes); +} -- cgit v1.2.3