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 0c0455f
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 67 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
90 changes: 48 additions & 42 deletions Source/MediaInfo/Audio/File_Adm.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 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 Expand Up @@ -1913,7 +1913,7 @@ const Ztring &File__Analyze::Retrieve_Const (stream_t StreamKind, size_t StreamP
|| StreamPos>=(*Stream)[StreamKind].size()
|| Parameter>=MediaInfoLib::Config.Info_Get(StreamKind).size()+(*Stream_More)[StreamKind][StreamPos].size())
{
if (StreamKind<sizeof(Fill_Temp)/sizeof(vector<fill_temp_item>))
if (StreamKind<=Stream_Max)
{
Ztring Parameter_Local;
Parameter_Local.From_Number(Parameter);
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
1 change: 1 addition & 0 deletions Source/MediaInfo/Multiple/File_Mpeg4_Descriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ int8u Mpeg4_Descriptors_ToAudioProfileLevelIndication(const profilelevel_struct&
{
case UnspecifiedAudio : return 0xFE;
case NoAudio : return 0xFF;
default:;
}
for (size_t i = 0; i < Mpeg4_Descriptors_AudioProfileLevelIndication_Size; i++)
if (ToMatch == Mpeg4_Descriptors_AudioProfileLevelIndication_Mapping[i])
Expand Down
8 changes: 7 additions & 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 All @@ -2214,6 +2214,9 @@ void File_Mpeg4::mdat_xxxx()
{
auto Probe=Config->File_ProbeCaption_Get(ParserName);
switch (Probe.Start_Type) {
case config_probe_none:
ProbeCaption_mdatPos=File_Size;
break;
case config_probe_dur:
ProbeCaption_mdatPos=Probe.Start*FrameRate;
break;
Expand All @@ -2227,6 +2230,9 @@ void File_Mpeg4::mdat_xxxx()
break;
}
switch (Probe.Duration_Type) {
case config_probe_none:
ProbeCaption_mdatDur=0;
break;
case config_probe_dur:
ProbeCaption_mdatDur=Probe.Duration*FrameRate;
break;
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
6 changes: 6 additions & 0 deletions Source/MediaInfo/Multiple/File_Mxf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15661,6 +15661,9 @@ bool File_Mxf::BookMark_Needed()
}
switch (Probe.Start_Type)
{
case config_probe_none:
ProbeCaptionBytePos=0;
break;
case config_probe_size:
ProbeCaptionBytePos=Probe.Start;
break;
Expand All @@ -15678,6 +15681,9 @@ bool File_Mxf::BookMark_Needed()
default:;
}
switch (Probe.Duration_Type) {
case config_probe_none:
ProbeCaptionByteDur=ContentSize;
break;
case config_probe_size:
ProbeCaptionByteDur=Probe.Duration;
break;
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/Multiple/File_Nsv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ void File_Nsv::Data_Parse()
if (P->AudioDelay!=numeric_limits<int64s>::min() && Retrieve(Stream_Audio, 0, Audio_Delay).empty())
Fill(Stream_Audio, 0, Audio_Delay, float64_int64s(((float64)P->AudioDelay)/1000000));
break;
default:;
}
}
}
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)
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 0c0455f

Please sign in to comment.