From b8e63574a50587cbfaeae5394ce8347290426b4d Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Thu, 28 Apr 2022 10:05:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=B9Parental=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java index 57831df3..7a46ee7d 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java @@ -219,7 +219,8 @@ public class XmlUtil { deviceChannel.setParental(0); } } else { - deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental"))); + // 由于海康会错误的发送65535作为这里的取值,所以这里除非是0否则认为是1 + deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental")) == 1?1:0); } deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID")); String parentId = XmlUtil.getText(itemDevice, "ParentID");