Commit 41c7137e3a2e6512756ce9c9d8cda9e636805f13

Authored by 648540858
Committed by GitHub
2 parents a23c1aca db493e26

Merge pull request #1242 from criver31/wvp-28181-2.0

1、修复zlm重连不在线  2、单端口下历史回放暂停和恢复发送的流ID与zlm不一致
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -699,6 +699,7 @@ public class MediaServerServiceImpl implements IMediaServerService { @@ -699,6 +699,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
699 ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null); 699 ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null);
700 String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItem.getId(); 700 String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItem.getId();
701 redisTemplate.opsForValue().set(key, mediaServerItem); 701 redisTemplate.opsForValue().set(key, mediaServerItem);
  702 + resetOnlineServerItem(mediaServerItem);
702 clearRTPServer(mediaServerItem); 703 clearRTPServer(mediaServerItem);
703 } 704 }
704 final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId(); 705 final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId();
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
@@ -954,7 +954,9 @@ public class PlayServiceImpl implements IPlayService { @@ -954,7 +954,9 @@ public class PlayServiceImpl implements IPlayService {
954 throw new ServiceException("mediaServer不存在"); 954 throw new ServiceException("mediaServer不存在");
955 } 955 }
956 // zlm 暂停RTP超时检查 956 // zlm 暂停RTP超时检查
957 - JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, streamId); 957 + // 使用zlm中的流ID
  958 + String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase();
  959 + JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, ssrc);
958 if (jsonObject == null || jsonObject.getInteger("code") != 0) { 960 if (jsonObject == null || jsonObject.getInteger("code") != 0) {
959 throw new ServiceException("暂停RTP接收失败"); 961 throw new ServiceException("暂停RTP接收失败");
960 } 962 }
@@ -977,7 +979,9 @@ public class PlayServiceImpl implements IPlayService { @@ -977,7 +979,9 @@ public class PlayServiceImpl implements IPlayService {
977 throw new ServiceException("mediaServer不存在"); 979 throw new ServiceException("mediaServer不存在");
978 } 980 }
979 // zlm 暂停RTP超时检查 981 // zlm 暂停RTP超时检查
980 - JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, streamId); 982 + // 使用zlm中的流ID
  983 + String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase();
  984 + JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, ssrc);
981 if (jsonObject == null || jsonObject.getInteger("code") != 0) { 985 if (jsonObject == null || jsonObject.getInteger("code") != 0) {
982 throw new ServiceException("继续RTP接收失败"); 986 throw new ServiceException("继续RTP接收失败");
983 } 987 }