推流不稳定问题修复

This commit is contained in:
wangwei 2023-10-13 14:20:17 +08:00
parent 2843072216
commit ab34fa7113
2 changed files with 25 additions and 4 deletions

View File

@ -249,7 +249,7 @@ public class CommandManagerImpl implements CommandManager {
} }
} }
if (config.isDebug()) if (config.isDebug())
log.info("停止了" + index + "个任务!"); log.info("停止了" + index + "个任务!名称:{}",index>0?tasker.getId():"null");
return index; return index;
} }

View File

@ -338,10 +338,32 @@ public class RtmpLiveService {
oldMsg=map1.get("oldMsg")==null?"":map1.get("oldMsg").toString(); oldMsg=map1.get("oldMsg")==null?"":map1.get("oldMsg").toString();
oldtime=Long.parseLong(map1.get("oldtime")==null?"0":map1.get("oldtime").toString()); oldtime=Long.parseLong(map1.get("oldtime")==null?"0":map1.get("oldtime").toString());
} }
if (status==0){ if (status==0&&manager.queryAll().size()>0){
log.info("停止推流20");
if (manager.queryAll().size()>0){
manager.stopAll();
manager.destory();
}
Thread.sleep(5000);
if (manager.queryAll().size()>0){
log.info("延迟检测推流1");
manager.stopAll();
manager.destory();
}
log.info("无任务停止监听1");
break; break;
} }
Thread.sleep(200); if (status==0&&manager.queryAll().size()==0){
log.info("无任务停止监听2");
Thread.sleep(5000);
if (manager.queryAll().size()>0){
log.info("延迟检测推流关闭");
manager.stopAll();
manager.destory();
}
break;
}
Thread.sleep(400);
} }
} }
@ -368,7 +390,6 @@ public class RtmpLiveService {
log.info("推流失败,重新推流"); log.info("推流失败,重新推流");
} }
} }
} }
Map map = new HashMap(); Map map = new HashMap();
map.put("oldtime",oldtime); map.put("oldtime",oldtime);