summaryrefslogtreecommitdiffstats
path: root/audio/format.c
diff options
context:
space:
mode:
authorTom Yan <tom.ty89@gmail.com>2018-08-21 08:34:23 +0800
committerJan Ekström <jeebjp@gmail.com>2018-09-29 23:06:49 +0300
commit0a92548684370a60e54c572e666b997a2bf9d572 (patch)
tree5cc57952a54d12907c28fbf4387f73f36ae8c5f4 /audio/format.c
parent56098c56368fb1c42059a3a125897f4d3e42553b (diff)
downloadmpv-0a92548684370a60e54c572e666b997a2bf9d572.tar.bz2
mpv-0a92548684370a60e54c572e666b997a2bf9d572.tar.xz
ao_pulse: fix tlength calculation
also remove the now unused non-sensical af_fmt_seconds_to_bytes. (cherry picked from commit 9d6b15ab32d4c231574f392c193a53e865b2206d)
Diffstat (limited to 'audio/format.c')
-rw-r--r--audio/format.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/audio/format.c b/audio/format.c
index a5fcf36e37..f56546a207 100644
--- a/audio/format.c
+++ b/audio/format.c
@@ -135,17 +135,6 @@ const char *af_fmt_to_str(int format)
return "??";
}
-int af_fmt_seconds_to_bytes(int format, float seconds, int channels, int samplerate)
-{
- assert(!af_fmt_is_planar(format));
- int bps = af_fmt_to_bytes(format);
- int framelen = channels * bps;
- int bytes = seconds * bps * samplerate;
- if (bytes % framelen)
- bytes += framelen - (bytes % framelen);
- return bytes;
-}
-
void af_fill_silence(void *dst, size_t bytes, int format)
{
memset(dst, af_fmt_is_unsigned(format) ? 0x80 : 0, bytes);