Skip to content

Commit

Permalink
Explained timecode rate snapping
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Minor <[email protected]>
  • Loading branch information
jminor committed Nov 14, 2024
1 parent 0ab3b19 commit f8aaf84
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/opentime/rationalTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ RationalTime::to_timecode(
return std::string();
}

// It is common practice to use truncated or rounded values
// like 29.97 instead of exact SMPTE rates like 30000/1001
// so as a convenience we will snap the rate to the nearest
// SMPTE rate if it is close enough.
double nearest_smpte_rate = nearest_smpte_timecode_rate(rate);
if (abs(nearest_smpte_rate - rate) > 0.1)
{
Expand Down

0 comments on commit f8aaf84

Please sign in to comment.