From cb8011909063b330f5da6cdb03c2e329b97b18a2 Mon Sep 17 00:00:00 2001
From: 朱俊杰 <502612493@qq.com>
Date: 星期四, 31 三月 2022 09:19:45 +0800
Subject: [PATCH] 订阅查询错误和空指针
---
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
index 4a22546..930bb33 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
@@ -109,7 +109,6 @@
// 褰曞儚鏌ヨ浠hannelId浣滀负deviceId鏌ヨ
String key = DeferredResultHolder.CALLBACK_CMD_STOP + deviceId + channelId;
resultHolder.put(key, uuid, result);
- Device device = storager.queryVideoDevice(deviceId);
StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(deviceId, channelId);
if (streamInfo == null) {
RequestMessage msg = new RequestMessage();
@@ -120,15 +119,14 @@
storager.stopPlay(deviceId, channelId);
return result;
}
- cmder.streamByeCmd(deviceId, channelId, streamInfo.getStream(), (event) -> {
+ cmder.streamByeCmd(deviceId, channelId, streamInfo.getStream(), null, eventResult -> {
redisCatchStorage.stopPlay(streamInfo);
storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
- RequestMessage msg = new RequestMessage();
- msg.setId(uuid);
- msg.setKey(key);
- //Response response = event.getResponse();
- msg.setData(String.format("success"));
- resultHolder.invokeAllResult(msg);
+ RequestMessage msgForSuccess = new RequestMessage();
+ msgForSuccess.setId(uuid);
+ msgForSuccess.setKey(key);
+ msgForSuccess.setData(String.format("success"));
+ resultHolder.invokeAllResult(msgForSuccess);
});
if (deviceId != null || channelId != null) {
@@ -174,7 +172,7 @@
public ResponseEntity<String> playConvert(@PathVariable String streamId) {
StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
if (streamInfo == null) {
- streamInfo = redisCatchStorage.queryPlaybackByStreamId(streamId);
+ streamInfo = redisCatchStorage.queryPlayback(null, null, streamId, null);
}
if (streamInfo == null) {
logger.warn("瑙嗛杞爜API璋冪敤澶辫触锛�, 瑙嗛娴佸凡缁忓仠姝�!");
--
Gitblit v1.8.0