优化异常处理

This commit is contained in:
648540858
2022-09-01 17:53:00 +08:00
parent 703c2e292a
commit 3146e63fc0
12 changed files with 47 additions and 39 deletions

View File

@@ -54,9 +54,10 @@ public class MediaServiceImpl implements IMediaService {
if (mediaInfo == null) {
return null;
}
String calld = null;
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream);
if (streamAuthorityInfo == null) {
return null;
if (streamAuthorityInfo != null) {
calld = streamAuthorityInfo.getCallId();
}
JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaInfo, app, stream);
if (mediaList != null) {
@@ -68,7 +69,7 @@ public class MediaServiceImpl implements IMediaService {
JSONObject mediaJSON = JSON.parseObject(JSON.toJSONString(data.get(0)), JSONObject.class);
JSONArray tracks = mediaJSON.getJSONArray("tracks");
if (authority) {
streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, addr,streamAuthorityInfo.getCallId());
streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, addr, calld);
}else {
streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, addr,null);
}

View File

@@ -296,7 +296,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
public boolean start(String app, String stream) {
boolean result = false;
StreamProxyItem streamProxy = videoManagerStorager.queryStreamProxy(app, stream);
if (!streamProxy.isEnable() ) {
if (streamProxy != null && !streamProxy.isEnable() ) {
JSONObject jsonObject = addStreamProxyToZlm(streamProxy);
if (jsonObject == null) {
return false;