Merge "Stop current tuning before starting a new tuning."
diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp
index 8e83d06..4385461 100644
--- a/tv/tuner/aidl/default/Demux.cpp
+++ b/tv/tuner/aidl/default/Demux.cpp
@@ -343,6 +343,10 @@
 }
 
 void Demux::startFrontendInputLoop() {
+    ALOGD("[Demux] start frontend on demux");
+    // Stop current Frontend thread loop first, in case the user starts a new
+    // tuning before stopping current tuning.
+    stopFrontendInput();
     mFrontendInputThreadRunning = true;
     mFrontendInputThread = std::thread(&Demux::frontendInputThreadLoop, this);
 }