Add record_max_nf()
authorHugo Villeneuve <hugo@hugovil.com>
Wed, 25 Oct 2023 20:32:57 +0000 (16:32 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 25 Oct 2023 20:32:57 +0000 (16:32 -0400)
fgen.sh

diff --git a/fgen.sh b/fgen.sh
index b1bd4e2..5ffb9d7 100755 (executable)
--- a/fgen.sh
+++ b/fgen.sh
@@ -160,6 +160,13 @@ function insert_empty_frames()
     done
 }
 
+function record_max_nf()
+{
+    if [ ${nf} -gt ${max_nf} ]; then
+        max_nf="${nf}"
+    fi
+}
+
 function generate_video()
 {
     local png_files
@@ -290,6 +297,7 @@ if [ ${trames} -eq 1 ]; then
     convert -size ${size} xc:none ${dest}/background.png
 
     nf=""
+    max_nf="0"
     oldnf=""
     files=""
     group="default"
@@ -355,6 +363,7 @@ if [ ${trames} -eq 1 ]; then
             fi
 
             log_dbg "New frame ID: ${nf}"
+            record_max_nf
 
             fname=$(get_frame_name ${nf})