|
@@ -181,24 +181,25 @@ public class ApiStreamController {
|
|
|
StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(serial, code);
|
|
|
if (streamInfo == null) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
- result.put("error","未找到流信息");
|
|
|
+ result.put("error", "未找到流信息");
|
|
|
return result;
|
|
|
}
|
|
|
Device device = deviceService.getDevice(serial);
|
|
|
+ redisCatchStorage.stopPlay(streamInfo);
|
|
|
+ storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
|
|
|
if (device == null) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
- result.put("error","未找到设备");
|
|
|
+ result.put("error", "未找到设备");
|
|
|
return result;
|
|
|
}
|
|
|
try {
|
|
|
cmder.streamByeCmd(device, code, streamInfo.getStream(), null);
|
|
|
} catch (InvalidArgumentException | ParseException | SipException | SsrcTransactionNotFoundException e) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
- result.put("error","发送BYE失败:" + e.getMessage());
|
|
|
+ result.put("error", "发送BYE失败:" + e.getMessage());
|
|
|
return result;
|
|
|
}
|
|
|
- redisCatchStorage.stopPlay(streamInfo);
|
|
|
- storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|