From: Lars Op den Kamp Date: Fri, 1 Jun 2012 08:29:06 +0000 (+0200) Subject: cec-client: only active the source when reconnecting if libcec was the active source... X-Git-Tag: upstream/2.2.0~1^2~23^2^2~14 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=610eff5714288ffbce3db6992dc439dc1dc3e481;p=deb_libcec.git cec-client: only active the source when reconnecting if libcec was the active source before closing the connection --- diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index 34fd387..57f6197 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -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; }