cec: don't poll for a vendor ID in monitoring mode
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index d2c6020dd12361f97f3352c4b668202432acfefb..33644d8709d3972bb0ed6082f04ede397428ac0e 100644 (file)
@@ -99,6 +99,9 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command)
     case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS:
       HandleGiveSystemAudioModeStatus(command);
       break;
+    case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST:
+      HandleSetSystemAudioModeRequest(command);
+      break;
     default:
       UnhandledCommand(command);
       m_busDevice->GetProcessor()->AddCommand(command);
@@ -285,7 +288,7 @@ bool CCECCommandHandler::HandleRoutingChange(const cec_command &command)
 
     CCECBusDevice *device = GetDevice(command.initiator);
     if (device)
-      device->SetPhysicalAddress(iNewAddress, iOldAddress);
+      device->SetStreamPath(iNewAddress, iOldAddress);
   }
   return true;
 }
@@ -323,6 +326,17 @@ bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command)
   return true;
 }
 
+bool CCECCommandHandler::HandleSetSystemAudioModeRequest(const cec_command &command)
+{
+  if (command.parameters.size >= 1)
+  {
+    CCECBusDevice *device = GetDevice(command.destination);
+    if (device&& device->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM)
+      return ((CCECAudioSystem *) device)->SetSystemAudioMode(command);
+  }
+  return true;
+}
+
 bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &command)
 {
   CCECBusDevice *device = GetDevice(command.destination);