From: Lars Op den Kamp Date: Thu, 11 Oct 2012 12:13:22 +0000 (+0200) Subject: cec-client: fixed - wait for the source switch to finish when cec-client is called... X-Git-Tag: upstream/2.2.0~1^2~15^2^2~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6be5b63cf05d1672a7187451213f581369f7a3ee;p=deb_libcec.git cec-client: fixed - wait for the source switch to finish when cec-client is called with the -s switch --- diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index d170bfa..986884e 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -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; }