X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftestclient%2Fmain.cpp;h=24ddde594eb7b9abd67503c6ee3fd453c65012ed;hb=6be84fc462ace5e3b2bc0a0e68c3449de4310b33;hp=d170bfa44a791be7606384ef6f2bc8cbfb7d5c8b;hpb=95587b956c69ead0b46d301f5ca70e977890c3fd;p=deb_libcec.git diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index d170bfa..24ddde5 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -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_1; #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; }