diff --git a/packages/libpulseaudio/build.sh b/packages/libpulseaudio/build.sh index b0a471f11..06ee21084 100644 --- a/packages/libpulseaudio/build.sh +++ b/packages/libpulseaudio/build.sh @@ -1,7 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/PulseAudio TERMUX_PKG_DESCRIPTION="A featureful, general-purpose sound server - shared libraries" TERMUX_PKG_VERSION=12.2 -TERMUX_PKG_REVISION=8 +TERMUX_PKG_REVISION=9 TERMUX_PKG_SHA256=809668ffc296043779c984f53461c2b3987a45b7a25eb2f0a1d11d9f23ba4055 TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_DEPENDS="libltdl, libsndfile, libandroid-glob, libsoxr" diff --git a/packages/libpulseaudio/module-sles-sink.c b/packages/libpulseaudio/module-sles-sink.c index deee356ed..365de12f7 100644 --- a/packages/libpulseaudio/module-sles-sink.c +++ b/packages/libpulseaudio/module-sles-sink.c @@ -42,6 +42,7 @@ #include #include +#include PA_MODULE_AUTHOR("Lennart Poettering, Nathan Martynov"); PA_MODULE_DESCRIPTION("Android OpenSL ES sink"); @@ -125,10 +126,15 @@ static int pa_init_sles_player(struct userdata *u, pa_sample_spec *ss) { locator_bufferqueue.locatorType = SL_DATALOCATOR_BUFFERQUEUE; locator_bufferqueue.numBuffers = 8; - SLDataFormat_PCM pcm; - pcm.formatType = SL_DATAFORMAT_PCM; + SLAndroidDataFormat_PCM_EX pcm; + if (ss->format == PA_SAMPLE_FLOAT32LE) { + pcm.formatType = SL_ANDROID_DATAFORMAT_PCM_EX; + pcm.representation = SL_ANDROID_PCM_REPRESENTATION_FLOAT; + } else { + pcm.formatType = SL_DATAFORMAT_PCM; + } pcm.numChannels = ss->channels; - pcm.samplesPerSec = ss->rate * 1000; + pcm.sampleRate = ss->rate * 1000; pcm.bitsPerSample = pcm.containerSize = pa_sample_size(ss) * 8; pcm.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; pcm.endianness = SL_BYTEORDER_LITTLEENDIAN; @@ -249,7 +255,16 @@ int pa__init(pa_module*m) { ss = m->core->default_sample_spec; pa_channel_map_init_stereo(&map); - ss.format = ss.format > PA_SAMPLE_S16BE ? PA_SAMPLE_S32LE : PA_SAMPLE_S16LE; + switch (ss.format) { + case PA_SAMPLE_S16LE: + case PA_SAMPLE_S24LE: + case PA_SAMPLE_S32LE: + case PA_SAMPLE_FLOAT32LE: + break; + default: + pa_log("Sample format not supported"); + goto fail; + } pa_modargs_get_sample_rate(ma, &ss.rate); ss.channels = map.channels;