From 8cab9f23b07dca8aa20f117aaf420597f14a0fe3 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 21 Nov 2022 10:07:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8=E6=9D=A5?= =?UTF-8?q?=E6=BA=90IP=E4=BD=9C=E4=B8=BA=E6=B5=81ip=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmanager/gb28181/play/PlayController.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java index 68a8133c..885f121a 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java @@ -106,22 +106,24 @@ public class PlayController { resultHolder.invokeResult(msg); }); - // TODO 在点播未成功的情况下在此调用接口点播会导致返回的流地址ip错误 - deferredResultEx.setFilter(result1 -> { - WVPResult wvpResult1 = (WVPResult)result1; - WVPResult clone = null; - try { - clone = (WVPResult)wvpResult1.clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException(e); - } - if (clone.getCode() == ErrorCode.SUCCESS.getCode()) { - StreamInfo data = clone.getData().clone(); - data.channgeStreamIp(request.getLocalName()); - clone.setData(data); - } - return clone; - }); + if (userSetting.getUseSourceIpAsStreamIp()) { + // TODO 在点播未成功的情况下在此调用接口点播会导致返回的流地址ip错误 + deferredResultEx.setFilter(result1 -> { + WVPResult wvpResult1 = (WVPResult)result1; + WVPResult clone = null; + try { + clone = (WVPResult)wvpResult1.clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException(e); + } + if (clone.getCode() == ErrorCode.SUCCESS.getCode()) { + StreamInfo data = clone.getData().clone(); + data.channgeStreamIp(request.getLocalName()); + clone.setData(data); + } + return clone; + }); + } // 录像查询以channelId作为deviceId查询 resultHolder.put(key, uuid, deferredResultEx);