summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-03-17 18:04:40 +0100
committerMax Kellermann <max@musicpd.org>2019-03-17 18:04:40 +0100
commitb76d78e6aeae5a6e638194fed03bd003d5b9f49d (patch)
treee7da39c7dda04d73ea61b7e2279bce903ee784d0
parent0a6e484b1ab7cb0175464103fc93f550fd7e1c8e (diff)
output/sles: enable power saving mode
-rw-r--r--NEWS2
-rw-r--r--src/output/plugins/sles/SlesOutputPlugin.cxx8
2 files changed, 10 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 0060ff1ff..d140a88bf 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ ver 0.21.6 (not yet released)
* support abstract sockets on Linux
* Windows
- remove the unused libwinpthread-1.dll dependency
+* Android
+ - enable SLES power saving mode
ver 0.21.5 (2019/02/22)
* protocol
diff --git a/src/output/plugins/sles/SlesOutputPlugin.cxx b/src/output/plugins/sles/SlesOutputPlugin.cxx
index 3ebe08dfd..f1ef758e4 100644
--- a/src/output/plugins/sles/SlesOutputPlugin.cxx
+++ b/src/output/plugins/sles/SlesOutputPlugin.cxx
@@ -229,6 +229,14 @@ SlesOutput::Open(AudioFormat &audio_format)
SL_ANDROID_KEY_STREAM_TYPE,
&stream_type,
sizeof(stream_type));
+
+ /* MPD doesn't care much about latency, so let's
+ configure power saving mode */
+ SLuint32 performance_mode = SL_ANDROID_PERFORMANCE_POWER_SAVING;
+ (*android_config)->SetConfiguration(android_config,
+ SL_ANDROID_KEY_PERFORMANCE_MODE,
+ &performance_mode,
+ sizeof(performance_mode));
}
result = play_object.Realize(false);