From 70c20364af15fce16992fce499efc623823ce221 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 22 九月 2022 14:10:26 +0800 Subject: [PATCH] 修复流注销时移除流认证信息 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index f645b8a..cbecf0f 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -417,10 +417,11 @@ String schema = item.getSchema(); List<MediaItem.MediaTrack> tracks = item.getTracks(); boolean regist = item.isRegist(); - if (item.getOriginType() == OriginType.RTMP_PUSH.ordinal() - || item.getOriginType() == OriginType.RTSP_PUSH.ordinal() - || item.getOriginType() == OriginType.RTC_PUSH.ordinal()) { - if (regist) { + if (regist) { + if (item.getOriginType() == OriginType.RTMP_PUSH.ordinal() + || item.getOriginType() == OriginType.RTSP_PUSH.ordinal() + || item.getOriginType() == OriginType.RTC_PUSH.ordinal()) { + StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream); if (streamAuthorityInfo == null) { streamAuthorityInfo = StreamAuthorityInfo.getInstanceByHook(item); @@ -429,9 +430,9 @@ streamAuthorityInfo.setOriginTypeStr(item.getOriginTypeStr()); } redisCatchStorage.updateStreamAuthorityInfo(app, stream, streamAuthorityInfo); - }else { - redisCatchStorage.removeStreamAuthorityInfo(app, stream); } + }else { + redisCatchStorage.removeStreamAuthorityInfo(app, stream); } if ("rtsp".equals(schema)){ @@ -451,16 +452,12 @@ if (streamInfo!=null){ redisCatchStorage.stopPlay(streamInfo); storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); - // 濡傛灉姝e湪缁欎笂绾ф帹閫侊紝鍒欏彂閫乥ye - - }else{ streamInfo = redisCatchStorage.queryPlayback(null, null, stream, null); if (streamInfo != null) { redisCatchStorage.stopPlayback(streamInfo.getDeviceID(), streamInfo.getChannelId(), streamInfo.getStream(), null); } - // 濡傛灉姝e湪缁欎笂绾ф帹閫侊紝鍒欏彂閫乥ye } }else { if (!"rtp".equals(app)){ -- Gitblit v1.8.0