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

Method dttimepack

Source/MediaInfo/Audio/File_Dat.cpp:640–689  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

638
639//---------------------------------------------------------------------------
640void File_Dat::dttimepack(TimeCode& TC)
641{
642 // Parsing
643 int16u sample;
644 int8u pno1, pno23, index, h, m, s, f;
645 bool pro;
646 Get_SB ( pro, "pro");
647 if (pro) {
648 Skip_SB( "fill");
649 Get_S1 ( 2, pno1, "sid"); Param_Info1C(Dat_sid[pno1], Dat_sid[pno1]);
650 Get_S1 ( 2, pno23, "freq"); Param_Info2C(Dat_samples[pno23], Dat_samples[pno23], " samples");
651 Get_S1 ( 3, index, "xrate"); Param_Info2C(pno23 && Dat_xrate[index], Dat_xrate[index], " fps");
652 Get_S2 (11, sample, "sample");
653 }
654 else {
655 Get_S1 (3, pno1, "pno (program number) - 1");
656 Get_BCD( pno23, "pno (program number) - 2", "pno (program number) - 3");
657 Get_BCD( index, "index1", "index2");
658 }
659 Element_Begin1("dttimecode");
660 Get_BCD( h, "h1", "h2");
661 Get_BCD( m, "m1", "m2");
662 Get_BCD( s, "s1", "s2");
663 Get_BCD( f, "f1", "f2");
664 if (pro || (h != 0xAA && h != 0xBB)) {
665 auto FramesMax = TC.GetFramesMax();
666 auto FrameMax_Theory = pro ? (index <= 2 ? 29 : (((int32u)Dat_xrate[index]) - 1)) : (33 + ((s % 3) == 2));
667 if (f > FrameMax_Theory && FramesMax <= FrameMax_Theory) {
668 Fill_Conformance("dttimepack", "dttimepack is indicated as pro time code but contains frame numbers as if it is non pro time code");
669 FramesMax = 33 + ((s % 3) == 2);
670 }
671 else if (FramesMax < FrameMax_Theory) {
672 FramesMax = FrameMax_Theory;
673 }
674 bool IS1001fps = FramesMax != 32 && pro && (index == 1 || index == 2);
675 TC = TimeCode(h, m, s, f, FramesMax, TimeCode::FPS1001(IS1001fps).DropFrame(IS1001fps && index == 2));
676 Element_Info1(TC.ToString());
677 Element_Level--;
678 Element_Info1(TC.ToString());
679 Element_Level--;
680 Element_Info1(TC.ToString());
681 Element_Level--;
682 Element_Info1(TC.ToString());
683 Element_Level += 3;
684 if ((!pro && (pno1 >= 10 || pno23 == (int8u)-1 || index == (int8u)-1)) || (pro && (!Dat_samples[pno23] || (pno23 && !Dat_xrate[index]) || sample >= 1440)) || !TC.IsValid()) {
685 Element_Info1("Problem");
686 }
687 }
688 Element_End0();
689}
690
691//---------------------------------------------------------------------------
692void File_Dat::dtdatepack(string& Date)

Callers

nothing calls this directly

Calls 5

GetFramesMaxMethod · 0.80
DropFrameMethod · 0.80
TimeCodeClass · 0.70
ToStringMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected