cec: don't respond with a poll from the broadcast address when receiving in CSLComman...
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 31 May 2012 20:51:38 +0000 (22:51 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 31 May 2012 21:09:29 +0000 (23:09 +0200)
src/lib/implementations/SLCommandHandler.cpp

index f39aef8997f48a504387518e5fccdbc747a24b53..46ef3d75b3334f1f03c8cd9f63eac28543ff3b4e 100644 (file)
@@ -133,9 +133,17 @@ bool CSLCommandHandler::HandleDeviceVendorId(const cec_command &command)
 
   if (!SLInitialised() && command.initiator == CECDEVICE_TV)
   {
-    cec_command response;
-    cec_command::Format(response, command.destination, command.initiator, CEC_OPCODE_FEATURE_ABORT);
-    return Transmit(response);
+    CCECBusDevice *destination = m_processor->GetDevice(command.destination);
+    if (destination && (destination->GetLogicalAddress() == CECDEVICE_BROADCAST || destination->IsHandledByLibCEC()))
+    {
+      cec_logical_address initiator = destination->GetLogicalAddress();
+      if (initiator == CECDEVICE_BROADCAST)
+        initiator = m_processor->GetPrimaryDevice()->GetLogicalAddress();
+
+      cec_command response;
+      cec_command::Format(response, initiator, command.initiator, CEC_OPCODE_FEATURE_ABORT);
+      return Transmit(response);
+    }
   }
   return true;
 }