diff options
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 3cc0276104e..88a2f386b9b 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -3892,24 +3892,15 @@ static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op) { if (seq->type == SEQ_TYPE_TEXT) { TextVars *data = seq->effectdata; - char timecode_str[32]; - double sec; - int frac; - int len; - fprintf(file, "%d\n", iter++); - sec = FRA2TIME(seq->startdisp); - frac = 1000 * (sec - floor(sec)); - sec = floor(sec); - BLI_timecode_string_from_time(timecode_str, sizeof(timecode_str), 1, sec, FPS, USER_TIMECODE_SMPTE_FULL); - len = strlen(timecode_str); - timecode_str[len - 3] = 0; - fprintf(file, "%s,%d", timecode_str, frac); - sec = FRA2TIME(seq->enddisp); - BLI_timecode_string_from_time(timecode_str, sizeof(timecode_str), 1, sec, FPS, USER_TIMECODE_SMPTE_FULL); - len = strlen(timecode_str); - timecode_str[len - 3] = 0; - fprintf(file, " --> %s,%d\n", timecode_str, frac); - fprintf(file, "%s\n\n", data->text); + char timecode_str_start[32]; + char timecode_str_end[32]; + + BLI_timecode_string_from_time(timecode_str_start, sizeof(timecode_str_start), + -2, FRA2TIME(seq->startdisp), FPS, USER_TIMECODE_SUBRIP); + BLI_timecode_string_from_time(timecode_str_end, sizeof(timecode_str_end), + -2, FRA2TIME(seq->enddisp), FPS, USER_TIMECODE_SUBRIP); + + fprintf(file, "%d\n%s --> %s\n%s\n\n", iter++, timecode_str_start, timecode_str_end, data->text); } } SEQ_END |