summaryrefslogtreecommitdiff
path: root/android/hal-audio.c
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2014-04-17 01:50:38 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-04-17 10:02:15 +0300
commitc63a16d1567e4342ed4d660467dfd74a6e4aeb02 (patch)
treebef2373b264e5068d040eaf763ef1562018ba9e8 /android/hal-audio.c
parent364354381e7bb6311b2d2e6e17998d2f5f059221 (diff)
downloadbluez-c63a16d1567e4342ed4d660467dfd74a6e4aeb02.tar.gz
android/hal-audio: Adjust audio quality automatically
In case we go out of sync with audio clock and start skipping data to catch up, we also decrease audio quality to have better chance to avoid going out of sync in future, i.e. due to poor radio link quality. Quality is reset to default value on stream resume.
Diffstat (limited to 'android/hal-audio.c')
-rw-r--r--android/hal-audio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/android/hal-audio.c b/android/hal-audio.c
index 8bfde7c89..c4bd4feda 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -971,6 +971,8 @@ static bool resume_endpoint(struct audio_endpoint *ep)
ep->samples = 0;
ep->resync = false;
+ ep->codec->update_qos(ep->codec_data, QOS_POLICY_DEFAULT);
+
return true;
}
@@ -1117,6 +1119,9 @@ static bool write_data(struct a2dp_stream_out *out, const void *buffer,
if (diff > MAX_DELAY) {
warn("lag is %jums, resyncing", diff / 1000);
+
+ ep->codec->update_qos(ep->codec_data,
+ QOS_POLICY_DECREASE);
ep->resync = true;
}
}