cec-client: only active the source when reconnecting if libcec was the active source...
authorLars Op den Kamp <lars@opdenkamp.eu>
Fri, 1 Jun 2012 08:29:06 +0000 (10:29 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Fri, 1 Jun 2012 08:29:06 +0000 (10:29 +0200)
src/testclient/main.cpp

index 34fd38730821fd78e7e2c2f6045ad29344d62bde..57f61974c725d9e7e54e461fbe5e83b146e03b57 100644 (file)
@@ -774,14 +774,19 @@ bool ProcessCommandR(ICECAdapter *parser, const string &command, string & UNUSED
 {
   if (command == "r")
   {
+    bool bReactivate = parser->IsLibCECActiveSource();
+
     PrintToStdOut("closing the connection");
     parser->Close();
 
     PrintToStdOut("opening a new connection");
     parser->Open(g_strPort.c_str());
 
-    PrintToStdOut("setting active source");
-    parser->SetActiveSource();
+    if (bReactivate)
+    {
+      PrintToStdOut("setting active source");
+      parser->SetActiveSource();
+    }
     return true;
   }