修复拉流代理相关问题

This commit is contained in:
panlinlin
2024-07-20 23:31:38 +08:00
parent 80ac701748
commit 0b7d55ed74
6 changed files with 51 additions and 37 deletions

View File

@@ -93,5 +93,5 @@ public interface IStreamProxyService {
void delete(int id);
boolean start(int id);
StreamInfo start(int id);
}

View File

@@ -177,7 +177,8 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
}
private void delete(StreamProxy streamProxy) {
if (streamProxy.getPulling()) {
assert streamProxy != null;
if (streamProxy.getPulling() != null && streamProxy.getPulling()) {
stopProxy(streamProxy);
}
if(streamProxy.getGbId() > 0) {
@@ -441,13 +442,12 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
@Override
public boolean start(int id) {
public StreamInfo start(int id) {
StreamProxy streamProxy = streamProxyMapper.select(id);
if (streamProxy == null) {
throw new ControllerException(ErrorCode.ERROR404.getCode(), "代理信息未找到");
}
StreamInfo streamInfo = startProxy(streamProxy);
return streamInfo != null;
return startProxy(streamProxy);
}
private StreamInfo startProxy(StreamProxy streamProxy){