From f1e6800a15b48610edd081631b486663fb72b9c7 Mon Sep 17 00:00:00 2001 From: 0xb00bface <0xboobface@gmail.com> Date: Tue, 14 Sep 2021 18:05:00 +0200 Subject: [PATCH] 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 --- .../ctbrec/recorder/download/hls/AbstractHlsDownload.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java b/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java index d0499308..c5f52eab 100644 --- a/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java +++ b/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java @@ -358,7 +358,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload { if (nextSegmentNumber > 0 && playlist.seq > nextSegmentNumber) { recordingEvents.add(RecordingEvent.of("Missed segments: "+nextSegmentNumber+" < " + playlist.seq)); 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)) { BufferedWriter br = new BufferedWriter(new OutputStreamWriter(outputStream)); DateTimeFormatter dtf = DateTimeFormatter.ISO_LOCAL_TIME; @@ -369,7 +369,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload { } br.flush(); } catch (IOException e) { - e.printStackTrace(); + LOG.error("Couldn't write log file for missed segments", e); } } }