You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
775 B

diff --git a/audio/format.c b/audio/format.c
index 8a13698..982b9af 100644
--- a/audio/format.c
+++ b/audio/format.c
@@ -137,12 +137,9 @@ const char *af_fmt_to_str(int format)
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;
+ // fix --pulse-buffer
+ // https://github.com/termux/termux-packages/pull/2707#issuecomment-410841566
+ return samplerate * seconds * af_fmt_to_bytes(format) * channels;
}
void af_fill_silence(void *dst, size_t bytes, int format)