From 8bb1b2b94f07c2f9ebc4b2a63e9ace14765e3d8b Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 26 Oct 2020 16:50:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=92=AD=E6=94=BE=E6=B5=81?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E6=97=B6=E5=A2=9E=E5=8A=A0=E9=87=8D=E8=AF=95?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=E7=9A=84=E5=BB=B6=E6=97=B6=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E8=BF=87=E5=BA=A6=E9=A2=91=E7=B9=81=E7=9A=84API?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/vmanager/play/PlayController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java index 134e692c..640dd534 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java @@ -66,19 +66,23 @@ public class PlayController { try { if (System.currentTimeMillis() - startTime > 30 * 1000) { storager.stopPlay(streamInfo); + logger.info("播放等待超时"); return new ResponseEntity("timeout",HttpStatus.OK); }else { streamInfo = storager.queryPlayByDevice(deviceId, channelId); JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(streamId); if (rtpInfo != null && rtpInfo.getBoolean("exist") && streamInfo.getFlv() != null){ + logger.info("RTP已推流,查询编码信息:"+streamInfo.getFlv()); + Thread.sleep(2000); JSONObject mediaInfo = zlmresTfulUtils.getMediaInfo("rtp", "rtmp", streamId); if (mediaInfo.getInteger("code") == 0 && mediaInfo.getBoolean("online")) { lockFlag = false; + logger.info("媒体编码信息已获取"); JSONArray tracks = mediaInfo.getJSONArray("tracks"); streamInfo.setTracks(tracks); storager.startPlay(streamInfo); }else { - + logger.info("媒体编码信息未获取,2秒后重试..."); } }else { Thread.sleep(2000);