From fade50454093e07b0f5739ff4935702d255d0296 Mon Sep 17 00:00:00 2001 From: christian mueller Date: Wed, 11 Apr 2012 14:38:06 +0200 Subject: * [GAM-59] disconnect does not work with example controller * if MainConnection exists, new connection will be rejected Signed-off-by: christian mueller --- PluginControlInterface/src/CAmControlSenderBase.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PluginControlInterface/src/CAmControlSenderBase.cpp b/PluginControlInterface/src/CAmControlSenderBase.cpp index a0cca6b..4a315b3 100644 --- a/PluginControlInterface/src/CAmControlSenderBase.cpp +++ b/PluginControlInterface/src/CAmControlSenderBase.cpp @@ -68,7 +68,16 @@ am_Error_e CAmControlSenderBase::hookUserConnectionRequest(const am_sourceID_t s am_Handle_s handle; mControlReceiveInterface->getRoute(true, sourceID, sinkID, listRoutes); if (listRoutes.empty()) - return E_NOT_POSSIBLE; + return (E_NOT_POSSIBLE); + + std::vector listAllMainConnections; + mControlReceiveInterface->getListMainConnections(listAllMainConnections); + std::vector::iterator itAll(listAllMainConnections.begin()); + for(;itAll!=listAllMainConnections.end();++itAll) + { + if(itAll->sinkID==sinkID && itAll->sourceID==sourceID) + return (E_ALREADY_EXISTS); + } std::vector listHandleStaus; std::vector::iterator it(listRoutes[0].route.begin()); @@ -119,7 +128,7 @@ am_Error_e CAmControlSenderBase::hookUserDisconnectionRequest(const am_mainConne mainConnectionSet set; set.connectionID = connectionID; set.listHandleStaus = listHandleStaus; - mListOpenConnections.push_back(set); + mListOpenDisconnections.push_back(set); return E_OK; } -- cgit v1.2.1