Commit 41c7137e3a2e6512756ce9c9d8cda9e636805f13
Committed by
GitHub
Merge pull request #1242 from criver31/wvp-28181-2.0
1、修复zlm重连不在线 2、单端口下历史回放暂停和恢复发送的流ID与zlm不一致
Showing
2 changed files
with
7 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
| ... | ... | @@ -699,6 +699,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 699 | 699 | ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null); |
| 700 | 700 | String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItem.getId(); |
| 701 | 701 | redisTemplate.opsForValue().set(key, mediaServerItem); |
| 702 | + resetOnlineServerItem(mediaServerItem); | |
| 702 | 703 | clearRTPServer(mediaServerItem); |
| 703 | 704 | } |
| 704 | 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 | 954 | throw new ServiceException("mediaServer不存在"); |
| 955 | 955 | } |
| 956 | 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 | 960 | if (jsonObject == null || jsonObject.getInteger("code") != 0) { |
| 959 | 961 | throw new ServiceException("暂停RTP接收失败"); |
| 960 | 962 | } |
| ... | ... | @@ -977,7 +979,9 @@ public class PlayServiceImpl implements IPlayService { |
| 977 | 979 | throw new ServiceException("mediaServer不存在"); |
| 978 | 980 | } |
| 979 | 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 | 985 | if (jsonObject == null || jsonObject.getInteger("code") != 0) { |
| 982 | 986 | throw new ServiceException("继续RTP接收失败"); |
| 983 | 987 | } | ... | ... |