修复推流关联平台的bug again
This commit is contained in:
parent
66aac4526b
commit
e752dbd1a7
@ -46,4 +46,9 @@ public class SubscribeHolder {
|
|||||||
}
|
}
|
||||||
return platforms;
|
return platforms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeAllSubscribe(String platformId) {
|
||||||
|
mobilePositionMap.remove(platformId);
|
||||||
|
catalogMap.remove(platformId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ public class ZLMMediaListManager {
|
|||||||
if (gbStreams.size() > 0) {
|
if (gbStreams.size() > 0) {
|
||||||
for (GbStream gbStream : gbStreams) {
|
for (GbStream gbStream : gbStreams) {
|
||||||
// 出现使用相同国标Id的视频流时,使用新流替换旧流,
|
// 出现使用相同国标Id的视频流时,使用新流替换旧流,
|
||||||
if (queryKey != null) {
|
if (queryKey != null && gbStream.getApp().equals(mediaItem.getApp())) {
|
||||||
Matcher matcherForStream = pattern.matcher(gbStream.getStream());
|
Matcher matcherForStream = pattern.matcher(gbStream.getStream());
|
||||||
String queryKeyForStream = null;
|
String queryKeyForStream = null;
|
||||||
if (matcherForStream.find()) { //此处find()每次被调用后,会偏移到下一个匹配
|
if (matcherForStream.find()) { //此处find()每次被调用后,会偏移到下一个匹配
|
||||||
@ -144,12 +144,15 @@ public class ZLMMediaListManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StreamProxyItem streamProxyItem = gbStreamMapper.selectOne(transform.getApp(), transform.getStream());
|
// StreamProxyItem streamProxyItem = gbStreamMapper.selectOne(transform.getApp(), transform.getStream());
|
||||||
if (streamProxyItem != null) {
|
List<GbStream> gbStreamList = gbStreamMapper.selectByGBId(transform.getGbId());
|
||||||
transform.setGbStreamId(streamProxyItem.getGbStreamId());
|
if (gbStreamList != null && gbStreamList.size() == 1) {
|
||||||
transform.setPlatformId(streamProxyItem.getPlatformId());
|
transform.setGbStreamId(gbStreamList.get(0).getGbStreamId());
|
||||||
transform.setCatalogId(streamProxyItem.getCatalogId());
|
transform.setPlatformId(gbStreamList.get(0).getPlatformId());
|
||||||
|
transform.setCatalogId(gbStreamList.get(0).getCatalogId());
|
||||||
|
transform.setGbId(gbStreamList.get(0).getGbId());
|
||||||
gbStreamMapper.update(transform);
|
gbStreamMapper.update(transform);
|
||||||
|
streamPushMapper.del(gbStreamList.get(0).getApp(), gbStreamList.get(0).getStream());
|
||||||
}else {
|
}else {
|
||||||
transform.setCreateStamp(System.currentTimeMillis());
|
transform.setCreateStamp(System.currentTimeMillis());
|
||||||
gbStreamMapper.add(transform);
|
gbStreamMapper.add(transform);
|
||||||
|
@ -33,6 +33,19 @@ public interface GbStreamMapper {
|
|||||||
"mediaServerId=#{mediaServerId}," +
|
"mediaServerId=#{mediaServerId}," +
|
||||||
"status=${status} " +
|
"status=${status} " +
|
||||||
"WHERE app=#{app} AND stream=#{stream}")
|
"WHERE app=#{app} AND stream=#{stream}")
|
||||||
|
int updateByallAndStream(GbStream gbStream);
|
||||||
|
|
||||||
|
@Update("UPDATE gb_stream " +
|
||||||
|
"SET app=#{app}," +
|
||||||
|
"stream=#{stream}," +
|
||||||
|
"gbId=#{gbId}," +
|
||||||
|
"name=#{name}," +
|
||||||
|
"streamType=#{streamType}," +
|
||||||
|
"longitude=#{longitude}, " +
|
||||||
|
"latitude=#{latitude}," +
|
||||||
|
"mediaServerId=#{mediaServerId}," +
|
||||||
|
"status=${status} " +
|
||||||
|
"WHERE gbStreamId=#{gbStreamId}")
|
||||||
int update(GbStream gbStream);
|
int update(GbStream gbStream);
|
||||||
|
|
||||||
@Delete("DELETE FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
|
@Delete("DELETE FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
|
||||||
|
@ -772,7 +772,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
|||||||
try {
|
try {
|
||||||
if (streamProxyMapper.update(streamProxyItem) > 0) {
|
if (streamProxyMapper.update(streamProxyItem) > 0) {
|
||||||
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
|
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
|
||||||
if (gbStreamMapper.update(streamProxyItem) > 0) {
|
if (gbStreamMapper.updateByallAndStream(streamProxyItem) > 0) {
|
||||||
//事务回滚
|
//事务回滚
|
||||||
dataSourceTransactionManager.rollback(transactionStatus);
|
dataSourceTransactionManager.rollback(transactionStatus);
|
||||||
return false;
|
return false;
|
||||||
|
@ -305,6 +305,8 @@ public class PlatformController {
|
|||||||
// 停止发送位置订阅定时任务
|
// 停止发送位置订阅定时任务
|
||||||
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() + "_MobilePosition_" + parentPlatform.getServerGBId();
|
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() + "_MobilePosition_" + parentPlatform.getServerGBId();
|
||||||
dynamicTask.stop(key);
|
dynamicTask.stop(key);
|
||||||
|
// 删除缓存的订阅信息
|
||||||
|
subscribeHolder.removeAllSubscribe(parentPlatform.getServerGBId());
|
||||||
if (deleteResult) {
|
if (deleteResult) {
|
||||||
return new ResponseEntity<>("success", HttpStatus.OK);
|
return new ResponseEntity<>("success", HttpStatus.OK);
|
||||||
} else {
|
} else {
|
||||||
@ -341,7 +343,6 @@ public class PlatformController {
|
|||||||
* @param platformId 上级平台ID
|
* @param platformId 上级平台ID
|
||||||
* @param query 查询内容
|
* @param query 查询内容
|
||||||
* @param online 是否在线
|
* @param online 是否在线
|
||||||
* @param choosed 是否已选中
|
|
||||||
* @param channelType 通道类型
|
* @param channelType 通道类型
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user