OSDN Git Service

TIF: fix JTvInputHal::removeStream issue
authorWonsik Kim <wonsik@google.com>
Tue, 5 Aug 2014 06:35:07 +0000 (15:35 +0900)
committerWonsik Kim <wonsik@google.com>
Tue, 5 Aug 2014 07:30:51 +0000 (07:30 +0000)
Bug: 16803334
Change-Id: I3f92a12479cdded7a3bf572cc59e68367a0797ad

services/core/jni/com_android_server_tv_TvInputHal.cpp

index 5eb627b..d5abe0c 100644 (file)
@@ -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;