Browse Source

推流不稳定问题修复

master
wangwei 11 months ago
parent
commit
ab34fa7113
2 changed files with 25 additions and 4 deletions
  1. +1
    -1
      src/main/java/com/github/bluesbruce/ffch/CommandManagerImpl.java
  2. +24
    -3
      src/main/java/com/github/bluesbruce/spring/service/RtmpLiveService.java

+ 1
- 1
src/main/java/com/github/bluesbruce/ffch/CommandManagerImpl.java View File

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


+ 24
- 3
src/main/java/com/github/bluesbruce/spring/service/RtmpLiveService.java View File

@@ -338,10 +338,32 @@ public class RtmpLiveService {
oldMsg=map1.get("oldMsg")==null?"":map1.get("oldMsg").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;
}
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("推流失败,重新推流");
}
}

}
Map map = new HashMap();
map.put("oldtime",oldtime);

Loading…
Cancel
Save