summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/jni/com_android_server_tv_TvInputHal.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/services/core/jni/com_android_server_tv_TvInputHal.cpp b/services/core/jni/com_android_server_tv_TvInputHal.cpp
index 5eb627b0fb6b..d5abe0c25dae 100644
--- a/services/core/jni/com_android_server_tv_TvInputHal.cpp
+++ b/services/core/jni/com_android_server_tv_TvInputHal.cpp
@@ -400,18 +400,15 @@ int JTvInputHal::removeStream(int deviceId, int streamId) {
connection.mSurface->setSidebandStream(NULL);
connection.mSurface.clear();
}
+ if (connection.mThread != NULL) {
+ connection.mThread->shutdown();
+ connection.mThread.clear();
+ }
+ if (mDevice->close_stream(mDevice, deviceId, streamId) != 0) {
+ ALOGE("Couldn't remove stream");
+ return BAD_VALUE;
+ }
if (connection.mSourceHandle != NULL) {
- // Need to reset streams
- if (mDevice->close_stream(mDevice, deviceId, streamId) != 0) {
- ALOGE("Couldn't remove stream");
- return BAD_VALUE;
- }
-
- // Clear everything
- if (connection.mThread != NULL) {
- connection.mThread->shutdown();
- connection.mThread.clear();
- }
connection.mSourceHandle.clear();
}
return NO_ERROR;