From a7e503e88a9e5946312d53c7551eee977c01d82b Mon Sep 17 00:00:00 2001 From: Jonathan Hearn Date: Tue, 21 Dec 2021 17:04:51 +0000 Subject: [PATCH] #393 added support for frame rates: 48000/1001, 100 , 120000/1001 and 120 --- src/opentime/rationalTime.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/opentime/rationalTime.cpp b/src/opentime/rationalTime.cpp index 7246e1eb1..880817dd0 100644 --- a/src/opentime/rationalTime.cpp +++ b/src/opentime/rationalTime.cpp @@ -10,15 +10,17 @@ namespace opentime { namespace OPENTIME_VERSION { RationalTime RationalTime::_invalid_time{ 0, RationalTime::_invalid_rate }; -static constexpr std::array dropframe_timecode_rates{ { +static constexpr std::array dropframe_timecode_rates{ { // 23.976, // 23.98, // 23.97, // 24000.0/1001.0, 29.97, 30000.0 / 1001.0, + 48000.0 / 1001.0, 59.94, 60000.0 / 1001.0, + 120000.0 / 1001.0, } }; // currently unused: @@ -37,7 +39,7 @@ static constexpr std::array non_dropframe_timecode_rates }}; */ -static constexpr std::array valid_timecode_rates{ +static constexpr std::array valid_timecode_rates{ { 1.0, 12.0, 23.97, @@ -49,11 +51,15 @@ static constexpr std::array valid_timecode_rates{ 29.97, 30000.0 / 1001.0, 30.0, + 48000.0 / 1001.0, 48.0, 50.0, 59.94, 60000.0 / 1001.0, - 60.0 } + 60.0, + 100, + 120000.0 / 1001.0, + 120 } }; bool @@ -118,7 +124,14 @@ RationalTime::from_timecode( unsigned int last_pos = 0; for (unsigned int i = 0; i < 4; i++) { - fields[i] = timecode.substr(last_pos, 2); + if (i < 3) + { + fields[i] = timecode.substr(last_pos, 2); + } + else + { + fields[i] = timecode.substr(last_pos); + } last_pos = last_pos + 3; }