diff --git a/epitass.ml b/epitass.ml index 6d19adb8efd1f4be16cc3d62dc9a1a556913f5de..7229f4b1d6318118c627bc3716254734afd300bf 100644 --- a/epitass.ml +++ b/epitass.ml @@ -35,6 +35,7 @@ let override_style_mode = ref false in let override_alpha_mode = ref true in let backup_first_style_mode = ref true in let guess_backcolor_mode= ref true in +let warning_following_syllable_mode = ref false in let playResX = ref 800 in let playResY = ref 600 in let audio_file = ref "?video" in @@ -100,7 +101,7 @@ Arg.parse let (style_list,event_list) = Toyunda_raw_to_v4p_ass.create_ass_events_and_styles !font !outline_color !bold !italic !underline !strike_out !scalex !scaley !spacing !angle !borderstyle !outline !shadow !alignment !marginl !marginr !default_font_size !default_primary_color !default_secondary_color !default_back_color !default_marginv !default_alpha !framerate - !color_threshold !override_style_mode !override_alpha_mode !backup_first_style_mode !guess_backcolor_mode + !color_threshold !override_style_mode !override_alpha_mode !backup_first_style_mode !guess_backcolor_mode !warning_following_syllable_mode sorted_toyunda positioned_lines in (*let _ = prerr_endline "[Info] Generate ass\n" in*) diff --git a/epitass.standalone b/epitass.standalone index 1d6c8ff0777b4e49824f220ef71d40b7db19f6ac..c1f52bcba90a018786f8fa117c76cc2075fc5ca3 100755 Binary files a/epitass.standalone and b/epitass.standalone differ diff --git a/makefile b/makefile index 29a21c5922039b3cd5341a884a1ce7bf1f0fec4b..05b39b3b8d61fc0d695572b502e98dbccb8c5580 100644 --- a/makefile +++ b/makefile @@ -29,7 +29,7 @@ FORMATV4PASS=ass # Target par défaut : compilation et nettoyage -all: build clean +all: build standalone clean # Compilation build : $(PROGRAM) diff --git a/toyunda_raw_to_v4p_ass.ml b/toyunda_raw_to_v4p_ass.ml index 8fea8cf81b0870a00c62e783ea4a3c766f8db5e2..21707f7e613ac14b800c04199f9dec32d7c18783 100644 --- a/toyunda_raw_to_v4p_ass.ml +++ b/toyunda_raw_to_v4p_ass.ml @@ -314,7 +314,7 @@ type style = int(*id*) * int(*font_size*) * color(*primaryColour*) * color(*seco let create_ass_events_and_styles font outline_color bold italic underline strike_out scalex scaley spacing angle borderstyle outline shadow alignment marginl marginr default_font_size default_primary_color default_secondary_color default_back_color default_marginv default_alpha framerate -color_threshold override_style_mode override_alpha_mode backup_first_style_mode guess_backcolor_mode +color_threshold override_style_mode override_alpha_mode backup_first_style_mode guess_backcolor_mode warning_following_syllable_mode sorted_toyunda positioned_lines = (*For each pipe number*) @@ -523,9 +523,13 @@ sorted_toyunda positioned_lines = then if expected_frame == first_frame then (sf,"") else - let _ = Printf.eprintf "[Warning] Expected next syllable frame %d, got %d.\n" expected_frame sf in - let _ = if sf < expected_frame then Printf.eprintf "[ERROR] The previous syllable was too long, printing a negative \\k tag.\n" else () in - (first_frame, String.concat "" ["{\\k";string_of_int ((sf-expected_frame)*100/framerate);"}"]) + let _ = + if sf < expected_frame + then Printf.eprintf "[ERROR] The previous syllable was too long (%d>%d), printing a negative \\k tag.\n" expected_frame sf + else if warning_following_syllable_mode + then Printf.eprintf "[Warning] Expected next syllable frame %d, got %d.\n" expected_frame sf + else () in + (first_frame, String.concat "" ["{\\k";string_of_int ((sf-expected_frame)*100/framerate);"}"]) else (first_frame,"") in let kstring = string_of_int ((ef-sf)*100/framerate) in (*let _ = Printf.eprintf "[Test] kstring %s for ef-sf = %d-%d = %d | expected_frame=%d first_frame=%d \n" kstring ef sf (ef-sf) expected_frame first_frame in*)