From 9d6b15ab32d4c231574f392c193a53e865b2206d Mon Sep 17 00:00:00 2001 From: Tom Yan Date: Tue, 21 Aug 2018 08:34:23 +0800 Subject: ao_pulse: fix tlength calculation also remove the now unused non-sensical af_fmt_seconds_to_bytes. --- audio/format.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'audio/format.c') 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); -- cgit v1.2.3