mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 07:12:39 +00:00
ao_opensles: add guards for sample rate to use
Upstream "Wilhelm" (the Android OpenSLES implementation) supports only 8000 <= rate <= 192000. Make sure mpv resamples the audio when necessary.
This commit is contained in:
parent
17df53519f
commit
d1e9f4a159
@ -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 = MPCLAMP(ao->samplerate, 8000, 192000);
|
||||
|
||||
CHK(slCreateEngine(&p->sl, 0, NULL, 0, NULL, NULL));
|
||||
CHK((*p->sl)->Realize(p->sl, SL_BOOLEAN_FALSE));
|
||||
|
Loading…
Reference in New Issue
Block a user