termux-packages/packages/mpv/sles_rate.patch

14 lines
560 B
Diff
Raw Normal View History

diff --git a/audio/out/ao_opensles.c b/audio/out/ao_opensles.c
index 40ab5324b5..aef78c2dec 100644
--- a/audio/out/ao_opensles.c
+++ b/audio/out/ao_opensles.c
@@ -111,6 +111,8 @@ static int init(struct ao *ao)
// This AO only supports two channels at the moment
mp_chmap_from_channels(&ao->channels, 2);
+ // Upstream "Wilhelm" supports only 8000 <= rate <= 192000
+ ao->samplerate = MPMIN(MPMAX(ao->samplerate, 8000), 192000);
CHK(slCreateEngine(&p->sl, 0, NULL, 0, NULL, NULL));
CHK((*p->sl)->Realize(p->sl, SL_BOOLEAN_FALSE));