MCPcopy Create free account
hub / github.com/MediaArea/MediaInfoLib / ToFrames

Method ToFrames

Source/MediaInfo/TimeCode.cpp:821–843  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

819
820//---------------------------------------------------------------------------
821int64_t TimeCode::ToFrames() const
822{
823 if (!IsSet())
824 return 0;
825
826 int64_t TC = (int64_t(GetHours()) * 3600
827 + int64_t(GetMinutes()) * 60
828 + int64_t(GetSeconds())) * ((int64_t)GetFramesMax() + 1);
829
830 if (IsDropFrame() && GetFramesMax())
831 {
832 int64_t Dropped = 1 + (int64_t)(GetFramesMax() / 30);
833
834 TC -= int64_t(GetHours()) * 108 * Dropped
835 + (int64_t(GetMinutes()) / 10) * 18 * Dropped
836 + (int64_t(GetMinutes()) % 10) * 2 * Dropped;
837 }
838 TC += GetFrames();
839 if (IsNegative())
840 TC = -TC;
841
842 return TC;
843}
844
845//---------------------------------------------------------------------------
846int64_t TimeCode::ToMilliseconds() const

Callers 9

Merge_FillTimeCodeFunction · 0.80
TimeCode.cppFile · 0.80
IsParsing_mdat_SetMethod · 0.80
Streams_FinishMethod · 0.80
Read_Buffer_ContinueMethod · 0.80
PGCMethod · 0.80
Streams_FinishMethod · 0.80
Data_ParseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected