add patch from mpv-player/mpv#6047
This commit is contained in:
parent
47cdb7f70f
commit
26f487970d
20
packages/mpv/pulse-buffer.patch
Normal file
20
packages/mpv/pulse-buffer.patch
Normal file
@ -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…
Reference in New Issue
Block a user