Browse Source

add patch from mpv-player/mpv#6047

android-5
Oliver Schmidhauser 6 years ago
committed by Fredrik Fornwall
parent
commit
b6c6bfd477
  1. 20
      packages/mpv/pulse-buffer.patch

20
packages/mpv/pulse-buffer.patch

@ -0,0 +1,20 @@
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)
Loading…
Cancel
Save