From 23d4e73ed68e71b52f23038dec2339408be5dfef Mon Sep 17 00:00:00 2001 From: Leo Butler Date: Sun, 18 Apr 2021 06:55:59 -0500 Subject: [PATCH] improve RECORDING-NEW-FILE-NAME With the new file endings, we need to split file names at #\. and pick up the beginning (e.g. 1031_20210405000300) and add ending (e.g. h264.ts) but drop any middle parts. --- ffmpeg-myth.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ffmpeg-myth.scm b/ffmpeg-myth.scm index ebed68d..73cc25b 100755 --- a/ffmpeg-myth.scm +++ b/ffmpeg-myth.scm @@ -298,10 +298,9 @@ (define (recording-new-file-name file-name ending) - (let* ((old-ending (substring file-name (- (string-length file-name) 3))) - (n (- (string-length file-name) (if (string=? old-ending ".ts") 3 4)))) - (simple-format #f "~a.~a" (substring file-name 0 n) ending))) - + (let* ((base+exts (string-split file-name #\.)) + (base (car base+exts))) + (simple-format #f "~a.~a" base ending))) (define* (create-record-data-for-transcode rec) (let* ((rtn-list '()) (tr-rec rec)