Skip to content

Commit

Permalink
DTS Core IMAX detection as Commercial name, fix BroadcastMetadataPresent
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeMartinez committed Sep 29, 2023
1 parent 01d2c27 commit 09fe71d
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions Source/MediaInfo/Audio/File_Dts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2382,37 +2382,41 @@ void File_Dts::Rev2Aux()
// in the reserved data.
int8u Rev2Bytes;
Peek_B1(Rev2Bytes);
bool DmixIndexPresent=(Rev2Bytes&1)==1;
Rev2Bytes = (Rev2Bytes>>1)+1;
auto Rev2AUXDataByteSize=(Rev2Bytes>>1)+1;
if (Element_Size-Element_Offset>=Rev2Bytes && Dts_CRC_CCIT_Compute(Buffer+Buffer_Offset+Element_Offset, Rev2Bytes)==0)
{
BS_Begin();
// Will later use Rev2BitsRemain to skip padding up to CRC
int Rev2BitsRemain=(Rev2Bytes-2)*8-Data_BS_Remain();
auto Rev2BitsRemain=(Rev2AUXDataByteSize-2)*8-Data_BS_Remain();

Skip_S1(7, "Rev2AUXDataByteSize");
bool ESMetaDataFlag;
Get_SB(ESMetaDataFlag, "ESMetaDataFlag");
if (ESMetaDataFlag)
Skip_S1(8, "EmbESDownMixScaleIndex");

bool BroadcastMetadataPresent = false;
Get_SB(BroadcastMetadataPresent, "BroadcastMetadataPresent");
if (BroadcastMetadataPresent)
if (Rev2AUXDataByteSize>4)
{
bool DRCMetadataPresent, DialnormMetadataPresent;
Get_SB(DRCMetadataPresent, "DRCMetadataPresent");
Get_SB(DialnormMetadataPresent, "DialnormMetadata");
if (DRCMetadataPresent)
Skip_S1(4, "DRCversion_Rev2AUX");
auto Remain=Data_BS_Remain()%8;
if (Remain)
Skip_S1(Remain, "ByteAlign");
if (DRCMetadataPresent)
bool BroadcastMetadataPresent;
Get_SB (BroadcastMetadataPresent, "BroadcastMetadataPresent");
if (BroadcastMetadataPresent)
{
Element_Begin1("Rev2_DRCs");
for (int i=0; i<SubSubFrameCount; i++)
Skip_S1(8, "DRCCoeff_Rev2");
Element_Begin1("BroadcastMetadata");
bool DRCMetadataPresent, DialnormMetadataPresent;
Get_SB (DRCMetadataPresent, "DRCMetadataPresent");
Get_SB (DialnormMetadataPresent, "DialnormMetadata");
if (DRCMetadataPresent)
Skip_S1(4, "DRCversion_Rev2AUX");
auto Remain=Data_BS_Remain()%8;
if (Remain)
Skip_S1(Remain, "ByteAlign");
if (DRCMetadataPresent)
{
Element_Begin1("Rev2_DRCs");
for (int i=0; i<SubSubFrameCount; i++)
Skip_S1(8, "DRCCoeff_Rev2");
Element_End0();
}
Element_End0();
}

Expand Down

0 comments on commit 09fe71d

Please sign in to comment.