From 45237888e3867c7fcbc7d45c4e3b206aa981e4c2 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 02 十二月 2020 15:35:21 +0800
Subject: [PATCH] 修正使用默认配置
---
src/main/java/com/genersoft/iot/vmp/gb28181/session/SsrcUtil.java | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/SsrcUtil.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/SsrcUtil.java
index d524fb0..d6b75f8 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/SsrcUtil.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/SsrcUtil.java
@@ -9,7 +9,7 @@
/**
* @Description:SIP淇′护涓殑SSRC宸ュ叿绫汇�係SRC鍊肩敱10浣嶅崄杩涘埗鏁存暟缁勬垚鐨勫瓧绗︿覆锛岀涓�浣嶄负0浠h〃瀹炲喌锛屼负1鍒欎唬琛ㄥ洖鏀撅紱绗簩浣嶈嚦绗叚浣嶇敱鐩戞帶鍩烮D鐨勭4浣嶅埌绗�8浣嶇粍鎴愶紱鏈�鍚�4浣嶄负涓嶉噸澶嶇殑4涓暣鏁�
- * @author: songww
+ * @author: swwheihei
* @date: 2020骞�5鏈�10鏃� 涓婂崍11:57:57
*/
public class SsrcUtil {
@@ -70,14 +70,16 @@
*/
private static String getSN() {
String sn = null;
+ int index = 0;
if (notUsed.size() == 0) {
throw new RuntimeException("ssrc宸茬粡鐢ㄥ畬");
} else if (notUsed.size() == 1) {
sn = notUsed.get(0);
} else {
- sn = notUsed.get(new Random().nextInt(notUsed.size() - 1));
+ index = new Random().nextInt(notUsed.size() - 1);
+ sn = notUsed.get(index);
}
- notUsed.remove(0);
+ notUsed.remove(index);
isUsed.add(sn);
return sn;
}
--
Gitblit v1.8.0