possible fix for ucla timing issue

This commit is contained in:
wforums 2014-10-10 16:37:41 +02:00
parent 53be44dfdb
commit e8f8d04369

View File

@ -140,13 +140,13 @@ void write_cc_line_as_transcript2(struct eia608_screen *data, struct encoder_ctx
if (ccx_options.transcript_settings.showStartTime){ if (ccx_options.transcript_settings.showStartTime){
char buf1[80]; char buf1[80];
if (ccx_options.transcript_settings.relativeTimestamp){ if (ccx_options.transcript_settings.relativeTimestamp){
millis_to_date(start_time + context->subs_delay, buf1); millis_to_date(start_time, buf1);
fdprintf(context->out->fh, "%s|", buf1); fdprintf(context->out->fh, "%s|", buf1);
} }
else { else {
mstotime(start_time + context->subs_delay, &h1, &m1, &s1, &ms1); mstotime(start_time + context->subs_delay, &h1, &m1, &s1, &ms1);
time_t start_time_int = (start_time + context->subs_delay) / 1000; time_t start_time_int = start_time / 1000;
int start_time_dec = (start_time + context->subs_delay) % 1000; int start_time_dec = start_time % 1000;
struct tm *start_time_struct = gmtime(&start_time_int); struct tm *start_time_struct = gmtime(&start_time_int);
strftime(buf1, sizeof(buf1), "%Y%m%d%H%M%S", start_time_struct); strftime(buf1, sizeof(buf1), "%Y%m%d%H%M%S", start_time_struct);
fdprintf(context->out->fh, "%s%c%03d|", buf1,ccx_options.millis_separator,start_time_dec); fdprintf(context->out->fh, "%s%c%03d|", buf1,ccx_options.millis_separator,start_time_dec);