Commit 1e75b2567fa8a0f6aacb5c7660443e3cb07dc204
1 parent
9ef1a027
兼容海康ssrc问题
Showing
1 changed file
with
6 additions
and
3 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| @@ -274,9 +274,12 @@ public class PlayServiceImpl implements IPlayService { | @@ -274,9 +274,12 @@ public class PlayServiceImpl implements IPlayService { | ||
| 274 | if (ssrcIndex >= 0) { | 274 | if (ssrcIndex >= 0) { |
| 275 | //ssrc规定长度为10字节,不取余下长度以避免后续还有“f=”字段 TODO 后续对不规范的非10位ssrc兼容 | 275 | //ssrc规定长度为10字节,不取余下长度以避免后续还有“f=”字段 TODO 后续对不规范的非10位ssrc兼容 |
| 276 | String ssrcInResponse = contentString.substring(ssrcIndex + 2, ssrcIndex + 12); | 276 | String ssrcInResponse = contentString.substring(ssrcIndex + 2, ssrcIndex + 12); |
| 277 | - if (!ssrc.equals(ssrcInResponse) && device.isSsrcCheck()) { // 查询到ssrc不一致且开启了ssrc校验则需要针对处理 | ||
| 278 | - // 查询 ssrcInResponse 是否可用 | ||
| 279 | - if (mediaServerItem.isRtpEnable() && !mediaServerItem.getSsrcConfig().checkSsrc(ssrcInResponse)) { | 277 | + // 查询到ssrc不一致且开启了ssrc校验则需要针对处理 |
| 278 | + if (ssrc.equals(ssrcInResponse)) { | ||
| 279 | + return; | ||
| 280 | + } | ||
| 281 | + if (!mediaServerItem.isRtpEnable() || device.isSsrcCheck()) { | ||
| 282 | + if (!mediaServerItem.getSsrcConfig().checkSsrc(ssrcInResponse)) { | ||
| 280 | // ssrc 不可用 | 283 | // ssrc 不可用 |
| 281 | // 释放ssrc | 284 | // 释放ssrc |
| 282 | mediaServerService.releaseSsrc(mediaServerItem.getId(), finalSsrcInfo.getSsrc()); | 285 | mediaServerService.releaseSsrc(mediaServerItem.getId(), finalSsrcInfo.getSsrc()); |