Parcourir la Source

Added safety mechanism to prevent deletion when encoding failed

JTXman il y a 10 ans
Parent
commit
6130282c77
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      JTX-Encoder.bat

+ 1 - 2
JTX-Encoder.bat

@@ -335,7 +335,7 @@ if %toencode%=="true" (
335 335
 	if %1==2 call :hd "%~2" "%~np2_encode.mp4"
336 336
 	if %1==3 call :web "%~2" "%~np2_encode.mp4"
337 337
 	if %1==4 call :archives "%~2" "%~np2_encode.mp4"
338
-	del "%~2"
338
+	IF NOT ERRORLEVEL 1 del "%~2"
339 339
 )
340 340
 ::Le label :eof est pr‚defini et permet de retourner … l'endroit du code o— la routine a ‚t‚ appel‚e.
341 341
 goto:eof
@@ -378,7 +378,6 @@ goto:eof
378 378
 
379 379
 :fullhd
380 380
 title= ---- Encodeur du JTX ---- Encodage de %1 en FullHD
381
-
382 381
 ffmpeg.exe -i %1 -threads 0 -c:v libx264 -b:v 10M -r 25 -s 1920x1080 -x264opts level=4 -pix_fmt yuv420p -c:a aac -strict experimental -b:a 192k -y %2
383 382
 goto:eof
384 383
 :hd