Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/lib_ccx/ccx_decoders_608.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,10 @@ void handle_command(unsigned char c1, const unsigned char c2, ccx_decoder_608_co
// not the character typing time. This matches FFmpeg's timing behavior.
if (context->rollup_from_popon && !changes)
{
context->ts_start_of_current_line = get_fts(context->timing, context->my_field);
// Transcript: anchor to CR time for the next write_cc_line().
// SRT: preserve first-char time already set by write_char() for cvm at changes=1.
if (context->output_format == CCX_OF_TRANSCRIPT)
context->ts_start_of_current_line = get_fts(context->timing, context->my_field);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib_ccx/ccx_encoders_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void write_cc_buffer_to_gui(struct eia608_screen *data, struct encoder_ctx *cont
int write_cc_buffer_as_g608(struct eia608_screen *data, struct encoder_ctx *context);
int write_cc_buffer_as_transcript2(struct eia608_screen *data, struct encoder_ctx *context);

void write_cc_line_as_transcript2(struct eia608_screen *data, struct encoder_ctx *context, int line_number);
int write_cc_line_as_transcript2(struct eia608_screen *data, struct encoder_ctx *context, int line_number);

int write_cc_subtitle_as_srt(struct cc_subtitle *sub, struct encoder_ctx *context);
int write_cc_subtitle_as_ssa(struct cc_subtitle *sub, struct encoder_ctx *context);
Expand Down
9 changes: 5 additions & 4 deletions src/lib_ccx/ccx_encoders_transcript.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ int write_cc_subtitle_as_transcript(struct cc_subtitle *sub, struct encoder_ctx
}

// TODO Convert CC line to TEXT format and remove this function
void write_cc_line_as_transcript2(struct eia608_screen *data, struct encoder_ctx *context, int line_number)
int write_cc_line_as_transcript2(struct eia608_screen *data, struct encoder_ctx *context, int line_number)
{
int ret = 0;
int length = get_str_basic(context->subline, data->characters[line_number],
Expand All @@ -255,7 +255,7 @@ void write_cc_line_as_transcript2(struct eia608_screen *data, struct encoder_ctx
// is set for example by the write_char function, it possible that we don't have one in empty lines (unclear)
// For now, let's not consider this a bug as before and just return.
// fatal (EXIT_BUG_BUG, "Bug in timedtranscript (ts_start_of_current_line==-1). Please report.");
return;
return 0;
}

if (context->transcript_settings->showStartTime)
Expand Down Expand Up @@ -333,7 +333,9 @@ void write_cc_line_as_transcript2(struct eia608_screen *data, struct encoder_ctx
{
mprint("Warning:Loss of data\n");
}
return 1;
}
return 0;
// fprintf (wb->fh,encoded_crlf);
}

Expand All @@ -356,8 +358,7 @@ int write_cc_buffer_as_transcript2(struct eia608_screen *data, struct encoder_ct
}
}

write_cc_line_as_transcript2(data, context, i);
wrote_something = 1;
wrote_something |= write_cc_line_as_transcript2(data, context, i);
}
}

Expand Down
Loading