From 8cab9f23b07dca8aa20f117aaf420597f14a0fe3 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 21 十一月 2022 10:07:27 +0800
Subject: [PATCH] 修复使用来源IP作为流ip配置

---
 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java |   34 ++++++++++++++++++----------------
 1 files 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 68a8133..885f121 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 @@
 			resultHolder.invokeResult(msg);
 		});
 
-		// TODO 鍦ㄧ偣鎾湭鎴愬姛鐨勬儏鍐典笅鍦ㄦ璋冪敤鎺ュ彛鐐规挱浼氬鑷磋繑鍥炵殑娴佸湴鍧�ip閿欒
-		deferredResultEx.setFilter(result1 -> {
-			WVPResult<StreamInfo> wvpResult1 = (WVPResult<StreamInfo>)result1;
-			WVPResult<StreamInfo> clone = null;
-			try {
-				clone = (WVPResult<StreamInfo>)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<StreamInfo> wvpResult1 = (WVPResult<StreamInfo>)result1;
+				WVPResult<StreamInfo> clone = null;
+				try {
+					clone = (WVPResult<StreamInfo>)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;
+			});
+		}
 
 		// 褰曞儚鏌ヨ浠hannelId浣滀负deviceId鏌ヨ
 		resultHolder.put(key, uuid, deferredResultEx);

--
Gitblit v1.8.0