forked from j62/ctbrec
1
0
Fork 0

small hlsdl fixes

(cherry picked from commit 0c9c4c1e06321a9ee83994be8f6fd32a6e2c852a)
This commit is contained in:
reusedname 2024-12-03 14:17:56 +05:00
parent b4d0442f2c
commit 78accb906d
2 changed files with 6 additions and 5 deletions

View File

@ -114,8 +114,8 @@ public class Hlsdl {
.start(() -> { .start(() -> {
var w = new OutputStreamWriter(processLogStream); var w = new OutputStreamWriter(processLogStream);
long lastDownloadSize = 0; long lastDownloadSize = 0;
while (!Thread.currentThread().isInterrupted()) { try {
try { while (!Thread.currentThread().isInterrupted()) {
var line = process.inputReader().readLine(); var line = process.inputReader().readLine();
if (line == null) { if (line == null) {
@ -137,9 +137,10 @@ public class Hlsdl {
w.write(line); w.write(line);
w.write('\n'); w.write('\n');
} catch (IOException e) {
LOG.debug("{}", e);
} }
} catch (IOException e) {
if (process.isAlive())
LOG.debug("Error in stream while process is still alive {}", e);
} }
}); });
} }

View File

@ -50,7 +50,7 @@ public class HlsdlDownload extends AbstractDownload {
createTargetDirectory(); createTargetDirectory();
startHlsdlProcess(); startHlsdlProcess();
if (hlsdlProcess == null) { if (hlsdlProcess == null) {
throw new ProcessExitedUncleanException("Couldn't spawn FFmpeg"); throw new ProcessExitedUncleanException("Couldn't spawn Hlsdl");
} }
} }