Skip to content

Commit

Permalink
Also don't round fps
Browse files Browse the repository at this point in the history
  • Loading branch information
eric committed Mar 4, 2020
1 parent 9113147 commit 25284ef
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions comskip.c
Original file line number Diff line number Diff line change
Expand Up @@ -13758,7 +13758,7 @@ void OutputFrameArray(bool screenOnly)
Debug(1, "Could not open raw output file.\n");
return;
}
fprintf(raw, "sep=,\nframe,brightness,scene_change,logo,uniform,sound,minY,MaxY,ar_ratio,goodEdge,isblack,cutscene, MinX, MaxX, hasBright, Dimcount,PTS,%d",(int)(fps*100+0.5));
fprintf(raw, "sep=,\nframe,brightness,scene_change,logo,uniform,sound,minY,MaxY,ar_ratio,goodEdge,isblack,cutscene, MinX, MaxX, hasBright, Dimcount,PTS,%f",fps);
// for (k = 0; k < 32; k++) {
// fprintf(raw, ",b%3i", k);
// }
Expand Down Expand Up @@ -14021,12 +14021,24 @@ void ProcessCSV(FILE *in_file)
fps = t * 1.00000000000001;
if (strlen(line) > 131)
{
t = ((double)strtol(&line[131], NULL, 10))/100;
if (t > 99)
t = t / 10.0;
t = strtod(&line[131], NULL);

// Handle backward compatibility
if (strchr(&line[131], '.') == NULL) {
t /= 100.0;
if (t > 99) {
t /= 10.0;
}

if (t>0) {
fps = t * 1.00000000000001;
}
} else {
if (t > 0) {
fps = t;
}
}
}
if (t>0)
fps = t * 1.00000000000001;
InitComSkip();
frame_count = 1;
while (fgets(line, sizeof(line), in_file) != NULL)
Expand Down

0 comments on commit 25284ef

Please sign in to comment.