aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Turner <donturner@google.com>2020-11-24 18:03:15 +0000
committerDon Turner <dturner@users.noreply.github.com>2020-11-24 18:46:38 +0000
commitf78547cd57e45914f42d51eb60b7d9c3945faa57 (patch)
treeaa7c301fdc930f98fa56275147fc14c0a9ff42f8
parent0a65ae368d8b6a9a749f221448da8a4e90087f53 (diff)
downloadoboe-f78547cd57e45914f42d51eb60b7d9c3945faa57.tar.gz
Addressing Phil's feedback
-rw-r--r--samples/hello-oboe/src/main/cpp/HelloOboeEngine.cpp2
-rw-r--r--samples/shared/DefaultErrorCallback.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/samples/hello-oboe/src/main/cpp/HelloOboeEngine.cpp b/samples/hello-oboe/src/main/cpp/HelloOboeEngine.cpp
index fe3b8f3f..66aaaf69 100644
--- a/samples/hello-oboe/src/main/cpp/HelloOboeEngine.cpp
+++ b/samples/hello-oboe/src/main/cpp/HelloOboeEngine.cpp
@@ -36,7 +36,7 @@
*/
HelloOboeEngine::HelloOboeEngine()
: mLatencyCallback(std::make_unique<LatencyTuningCallback>()),
- mErrorCallback(std::make_unique<DefaultErrorCallback>(*this)){
+ mErrorCallback(std::make_unique<DefaultErrorCallback>(*this)) {
}
double HelloOboeEngine::getCurrentOutputLatencyMillis() {
diff --git a/samples/shared/DefaultErrorCallback.h b/samples/shared/DefaultErrorCallback.h
index 12a80749..b37f6978 100644
--- a/samples/shared/DefaultErrorCallback.h
+++ b/samples/shared/DefaultErrorCallback.h
@@ -38,13 +38,13 @@ public:
virtual ~DefaultErrorCallback() = default;
virtual void onErrorAfterClose(oboe::AudioStream *oboeStream, oboe::Result error) override {
- // Restart the stream when it errors out with disconnect
- if (error == oboe::Result::ErrorDisconnected) {
- LOGE("Restarting AudioStream after disconnect");
+ // Restart the stream if the error is a disconnect or a timeout, otherwise do nothing
+ // and log the error reason.
+ if (error == oboe::Result::ErrorDisconnected || error == oboe::Result::ErrorTimeout) {
+ LOGI("Restarting AudioStream");
mParent.restart();
- } else {
- LOGE("Unknown error");
}
+ LOGE("Error was %s", oboe::convertToText(error));
}
private: