summaryrefslogtreecommitdiffstats
path: root/audio/format.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-10 23:05:51 +0100
committerwm4 <wm4@nowhere>2013-11-10 23:05:59 +0100
commit3cb4116243e54b0452d88c70a7acd4af17cf8d02 (patch)
treef1e97c8d9f630e81c3e7e7c4022b87952bcfcc15 /audio/format.c
parent6ec1f317654ae1e1424ec7c519cf307aae7c3efe (diff)
downloadmpv-3cb4116243e54b0452d88c70a7acd4af17cf8d02.tar.bz2
mpv-3cb4116243e54b0452d88c70a7acd4af17cf8d02.tar.xz
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.
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);
+}