Skip to content

Commit

Permalink
TEMP
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeMartinez committed Feb 12, 2025
1 parent 5e8bc85 commit 5740bf9
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 63 deletions.
4 changes: 2 additions & 2 deletions Source/MediaInfo/Audio/File_Ac3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ const char* AC3_ChannelLayout_lfeon[]=
};

//---------------------------------------------------------------------------
extern const char* AC3_roomtyp[]=
const char* AC3_roomtyp[]=
{
"Large",
"Small",
"3",
};

//---------------------------------------------------------------------------
extern const char* AC3_dmixmod[]=
const char* AC3_dmixmod[]=
{
"Lt/Rt",
"Lo/Ro",
Expand Down
84 changes: 45 additions & 39 deletions Source/MediaInfo/Audio/File_Adm.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Source/MediaInfo/File__Analyze_Streams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void File__Analyze::Get_MasteringDisplayColorVolume(Ztring &MasteringDisplay_Col
#endif

//---------------------------------------------------------------------------
extern const char* DolbyVision_Compatibility[] =
const char* DolbyVision_Compatibility[] =
{
"",
"HDR10",
Expand Down Expand Up @@ -504,7 +504,7 @@ static void DolbyVision_Profiles_Append(string& Profile, int8u i)
return add_dec_2chars(Profile, i);
Profile.append(DolbyVision_Profiles_Names+((size_t)j)*4, 4);
}
extern const char* DolbyVision_Compression[] =
const char* DolbyVision_Compression[] =
{
"None",
"Limited",
Expand Down
3 changes: 1 addition & 2 deletions Source/MediaInfo/Multiple/File_Ancillary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,8 @@ void File_Ancillary::Read_Buffer_Unsynched()
//---------------------------------------------------------------------------
void File_Ancillary::Header_Parse()
{
switch (Format)
if (Format==Smpte2038)
{
case Smpte2038:
BS_Begin();
Skip_S1(6, "000000");
Skip_SB( "c_not_y_channel_flag");
Expand Down
9 changes: 4 additions & 5 deletions Source/MediaInfo/Multiple/File_DvDif_Analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,10 @@ void File_DvDif::Read_Buffer_Continue()
uint8_t Dseq=Buffer[Buffer_Offset+1]>>4;
bool Is16=(QU==(int8u)-1)?(Contains_8000):(QU==0);
int16u Value;
switch (Is16)
{
case 0: Value=(Contains_800800_0<<4)|(Contains_800800_1>>4); break; // Only one half
case 1: Value=(ToCheck_8000_0<<8)|ToCheck_8000_1; break;
}
if (Is16)
Value=(ToCheck_8000_0<<8)|ToCheck_8000_1;
else
Value=(Contains_800800_0<<4)|(Contains_800800_1>>4); // Only one half
if (Value && Value!=(0xFFFF>>(Is16?0:4))) // 0 and -1 are often used as silence
{
if (Channel>=Audio_Errors.size())
Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2194,7 +2194,7 @@ void File_Mpeg4::mdat_xxxx()
}
else
{
mdat_Pos=move(mdat_Pos_Caption);
mdat_Pos=std::move(mdat_Pos_Caption);
std::sort(mdat_Pos.begin(), mdat_Pos.end(), &mdat_pos_sort);
size_t mdat_Pos_Min=(size_t)-1;
size_t mdat_Pos_Max=0;
Expand Down
10 changes: 6 additions & 4 deletions Source/MediaInfo/Multiple/File_Mpeg_Descriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2583,13 +2583,15 @@ void File_Mpeg_Descriptors::Descriptor_3F_14()
Complete_Stream->Streams[elementary_PID]->Infos["BitRate_Maximum"].From_Number(brat*1000000);
if (Framerate_Numerator && Framerate_Denominator && Framerate_Denominator<=2)
{
int32u Num=Framerate_Numerator;
int32u Den=Framerate_Denominator;
if (Framerate_Denominator==2)
{
Framerate_Numerator*=1000;
Framerate_Denominator=1001;
Num*=1000;
Den=1001;
}
Complete_Stream->Streams[elementary_PID]->Infos["FrameRate_Num"].From_Number(Framerate_Numerator);
Complete_Stream->Streams[elementary_PID]->Infos["FrameRate_Den"].From_Number(Framerate_Denominator);
Complete_Stream->Streams[elementary_PID]->Infos["FrameRate_Num"].From_Number(Num);
Complete_Stream->Streams[elementary_PID]->Infos["FrameRate_Den"].From_Number(Den);
}
if (Interlace_Mode!=3)
{
Expand Down
16 changes: 11 additions & 5 deletions Source/MediaInfo/Text/File_N19.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ void File_N19::Data_Parse()
{
switch (Value)
{
case 0x8A: //EOL
case (decltype(Value))0x8A: //EOL
if (Line_HasContent)
{
LineCount++;
Expand All @@ -705,9 +705,11 @@ void File_N19::Data_Parse()
}
#if MEDIAINFO_TRACE
for (size_t i = 0; i < TF.size(); ++i)
switch (TF[i])
{
auto Value=TF[i];
switch (Value)
{
case 0x8A: //EOL
case (decltype(Value))0x8A: //EOL
TF[i] = EOL[0];
{
size_t j = 1;
Expand All @@ -720,15 +722,18 @@ void File_N19::Data_Parse()
|| (TF[i]>=0x7F && TF[i]<0xA0))
TF.erase(i--, 1);
}
}
Param_Info1(TF);
#endif //MEDIAINFO_TRACE

FILLING_BEGIN();
#if MEDIAINFO_DEMUX
for (size_t i = 0; i < TF.size(); ++i)
switch (TF[i])
{
auto Value=TF[i];
switch (Value)
{
case 0x8A: //EOL
case (decltype(Value))0x8A: //EOL
TF[i] = EOL[0];
{
size_t j = 1;
Expand All @@ -741,6 +746,7 @@ void File_N19::Data_Parse()
|| (TF[i]>=0x7F && TF[i]<0xA0))
TF.erase(i--, 1);
}
}

Frame_Count_NotParsedIncluded=Frame_Count;

Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/Video/File_Hevc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ void File_Hevc::video_parameter_set()
TESTELSE_SB_SKIP( "vps_extension_flag");
int8u view_id_len;
bool splitting_flag, vps_nuh_layer_id_present_flag;
for (auto Bits=Data_BS_Remain()%8; Bits--; Bits)
for (auto Bits=Data_BS_Remain()%8; Bits--; Bits>0)
Mark_1();
if (vps_max_layers_minus1 && vps_base_layer_internal_flag)
{
Expand Down
10 changes: 8 additions & 2 deletions Source/PreRelease/FieldsDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const char* StreamKinds[] =

ZtringListList Load(const string& Name, const char* ToAdd = nullptr, bool IgnoreErrors = false) {
File InF(Ztring().From_Local(Name));
auto Size = InF.Size_Get();
auto InF_Size = InF.Size_Get();
if (InF_Size > ((size_t)-1) / 2)
return {};
auto Size = (size_t)InF_Size;
if (Size == 0) {
if (!IgnoreErrors)
std::cerr << "Can not open " << Name << '\n';
Expand Down Expand Up @@ -157,7 +160,10 @@ int main(int argc, char* argv[]) {

string Name = string(argv[2]) + "/src/MediaInfoBundle/Resources/views/Support/fields.html.twig";
File OutputF(Ztring().From_Local(Name));
auto Size = OutputF.Size_Get();
auto OutputF_Size = OutputF.Size_Get();
if (OutputF_Size > ((size_t)-1) / 2)
return {};
auto Size = (size_t)OutputF_Size;
if (Size == 0) {
std::cerr << "Can not open " << Name << '\n';
return 1;
Expand Down

0 comments on commit 5740bf9

Please sign in to comment.