diff options
Diffstat (limited to 'audio/format.c')
-rw-r--r-- | audio/format.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |