diff --git a/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java b/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java index a847c14..0c92963 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java @@ -165,7 +165,7 @@ public class SaveLive { Process process=AppTools.exec(exec); InputStream inputStream = process.getErrorStream(); byte[] bytes = new byte[2048]; - while (inputStream.read(bytes) > -1) { + while (inputStream.read(bytes) > -1&&isSave) { //System.out.println(new String(bytes,StandardCharsets.UTF_8)); if(!isPrint){ com.yutou.bilibili.Tools.Log.i("开始录制:" + roomId); @@ -173,6 +173,7 @@ public class SaveLive { isPrint=true; } } + process.destroy(); System.out.println("----------------stop ffmpeg"); inputStream.close(); com.yutou.bilibili.Tools.Log.i("录制完成:" + roomId);