From 6be5b63cf05d1672a7187451213f581369f7a3ee Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 11 Oct 2012 14:13:22 +0200 Subject: [PATCH] cec-client: fixed - wait for the source switch to finish when cec-client is called with the -s switch --- src/testclient/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; } -- 2.34.1