bump version number to 2.0.3 and updated changelog
[deb_libcec.git] / src / testclient / main.cpp
index d170bfa44a791be7606384ef6f2bc8cbfb7d5c8b..d73d4cbe1a2b478cdaf20efc8c3042d69a9022a9 100644 (file)
@@ -48,7 +48,7 @@ using namespace CEC;
 using namespace std;
 using namespace PLATFORM;
 
-#define CEC_CONFIG_VERSION CEC_CLIENT_VERSION_2_0_0;
+#define CEC_CONFIG_VERSION CEC_CLIENT_VERSION_2_0_3;
 
 #include "../../include/cecloader.h"
 
@@ -537,6 +537,18 @@ bool ProcessCommandAS(ICECAdapter *parser, const string &command, string & UNUSE
   if (command == "as")
   {
     parser->SetActiveSource();
+    // wait for the source switch to finish for 15 seconds tops
+    if (g_bSingleCommand)
+    {
+      CTimeout timeout(15000);
+      bool bActiveSource(false);
+      while (timeout.TimeLeft() > 0 && !bActiveSource)
+      {
+        bActiveSource = parser->IsLibCECActiveSource();
+        if (!bActiveSource)
+          CEvent::Sleep(100);
+      }
+    }
     return true;
   }