From c8c70dce5719576648489f9d2bad1cf9b61495a1 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 16 Jun 2013 19:25:10 +0200 Subject: audio: fix af_fmt_seconds_to_bytes Was missing samplerate --- audio/format.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio/format.c') diff --git a/audio/format.c b/audio/format.c index f9bfcb5ba8..a65c10472d 100644 --- a/audio/format.c +++ b/audio/format.c @@ -110,11 +110,11 @@ static bool af_fmt_valid(int format) return (format & AF_FORMAT_MASK) == format; } -int af_fmt_seconds_to_bytes(int format, float seconds, int channels) +int af_fmt_seconds_to_bytes(int format, float seconds, int channels, int samplerate) { int bps = (af_fmt2bits(format) / 8); int framelen = channels * bps; - int bytes = seconds * bps; + int bytes = seconds * bps * samplerate; if (bytes % framelen) bytes += framelen - (bytes % framelen); return bytes; -- cgit v1.2.3