优化点播超时的处理,修复tcp主动点播时ssrc不一致时点播失败的问题

This commit is contained in:
648540858
2023-08-03 15:36:59 +08:00
parent 2e399faf41
commit 6797f77259
3 changed files with 50 additions and 35 deletions

View File

@@ -67,7 +67,7 @@ public class MediaController {
&& streamAuthorityInfo.getCallId().equals(callId)) {
authority = true;
}else {
throw new ControllerException(ErrorCode.ERROR400);
throw new ControllerException(ErrorCode.ERROR400.getCode(), "获取播放地址鉴权失败");
}
}else {
// 是否登陆用户, 登陆用户返回完整信息

View File

@@ -92,6 +92,7 @@ public class PlayController {
public DeferredResult<WVPResult<StreamContent>> play(HttpServletRequest request, @PathVariable String deviceId,
@PathVariable String channelId) {
logger.info("[开始点播] deviceId{}, channelId{}, ", deviceId, channelId);
// 获取可用的zlm
Device device = storager.queryVideoDevice(deviceId);
MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
@@ -104,13 +105,15 @@ public class PlayController {
DeferredResult<WVPResult<StreamContent>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue());
result.onTimeout(()->{
logger.info("点播接口等待超时");
logger.info("[点播等待超时] deviceId{}, channelId{}, ", deviceId, channelId);
// 释放rtpserver
WVPResult<StreamInfo> wvpResult = new WVPResult<>();
wvpResult.setCode(ErrorCode.ERROR100.getCode());
wvpResult.setMsg("点播超时");
requestMessage.setData(wvpResult);
resultHolder.invokeResult(requestMessage);
inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, deviceId, channelId);
storager.stopPlay(deviceId, channelId);
});
// 录像查询以channelId作为deviceId查询