summaryrefslogtreecommitdiffstats
path: root/audio/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/format.c')
-rw-r--r--audio/format.c6
1 files changed, 6 insertions, 0 deletions
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);
+}