forked from j62/ctbrec
Fix bug in handleMissedSegments
It used a path to /tmp in the createTempFile method, which caused Windows to complain with java.io.IOException: The filename, directory name, or volume label syntax is incorrect
This commit is contained in:
parent
ff9ce1d205
commit
f1e6800a15
|
@ -358,7 +358,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
|
||||||
if (nextSegmentNumber > 0 && playlist.seq > nextSegmentNumber) {
|
if (nextSegmentNumber > 0 && playlist.seq > nextSegmentNumber) {
|
||||||
recordingEvents.add(RecordingEvent.of("Missed segments: "+nextSegmentNumber+" < " + playlist.seq));
|
recordingEvents.add(RecordingEvent.of("Missed segments: "+nextSegmentNumber+" < " + playlist.seq));
|
||||||
if (config.getSettings().logMissedSegments) {
|
if (config.getSettings().logMissedSegments) {
|
||||||
File hlsEventsFile = File.createTempFile("/tmp/rec_evt_" + Instant.now() + "_" + model.getSanitizedNamed(), ".log");
|
File hlsEventsFile = File.createTempFile("rec_evt_" + Instant.now() + "_" + model.getSanitizedNamed(), ".log");
|
||||||
try (OutputStream outputStream = Files.newOutputStream(hlsEventsFile.toPath(), CREATE, WRITE, TRUNCATE_EXISTING)) {
|
try (OutputStream outputStream = Files.newOutputStream(hlsEventsFile.toPath(), CREATE, WRITE, TRUNCATE_EXISTING)) {
|
||||||
BufferedWriter br = new BufferedWriter(new OutputStreamWriter(outputStream));
|
BufferedWriter br = new BufferedWriter(new OutputStreamWriter(outputStream));
|
||||||
DateTimeFormatter dtf = DateTimeFormatter.ISO_LOCAL_TIME;
|
DateTimeFormatter dtf = DateTimeFormatter.ISO_LOCAL_TIME;
|
||||||
|
@ -369,7 +369,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
|
||||||
}
|
}
|
||||||
br.flush();
|
br.flush();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
LOG.error("Couldn't write log file for missed segments", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue