From 610eff5714288ffbce3db6992dc439dc1dc3e481 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 1 Jun 2012 10:29:06 +0200 Subject: [PATCH] cec-client: only active the source when reconnecting if libcec was the active source before closing the connection --- src/testclient/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } -- 2.34.1