Skip to content

Commit

Permalink
apply my patches to 0.7.68
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeguly committed Jun 6, 2014
1 parent 19397ee commit 7e0c213
Show file tree
Hide file tree
Showing 26 changed files with 104 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,11 @@ bool File_Ac3::FrameSynchPoint_Test()
Save_Buffer_Size=Buffer_Size;

//Exception handling
#ifdef __EXCEPTIONS
try
#else
if (true)
#endif // __EXCEPTIONS
{
int8u* Buffer_Little=new int8u[Size];
for (size_t Pos=0; Pos+1<Size; Pos+=2)
Expand All @@ -2314,7 +2318,11 @@ bool File_Ac3::FrameSynchPoint_Test()

delete[] Buffer_Little;
}
#ifdef __EXCEPTIONS
catch(...)
#else
if (false)
#endif // __EXCEPTIONS
{
}
Buffer=Save_Buffer; Save_Buffer=NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,9 @@ void File_SmpteSt0337::Data_Parse()
const int8u* Save_Buffer=NULL;
size_t Save_Buffer_Offset=0;
size_t Save_Buffer_Size=0;
#if MEDIAINFO_DEMUX
int64u Save_Element_Size=0;
#endif //MEDIAINFO_DEMUX

if (Endianness=='L'|| Container_Bits!=Stream_Bits)
{
Expand Down Expand Up @@ -1099,7 +1101,9 @@ void File_SmpteSt0337::Data_Parse()
Save_Buffer=Buffer;
Save_Buffer_Offset=Buffer_Offset;
Save_Buffer_Size=Buffer_Size;
#if MEDIAINFO_DEMUX
Save_Element_Size=Element_Size;
#endif //MEDIAINFO_DEMUX
File_Offset+=Buffer_Offset;
Buffer=Info;
Buffer_Offset=0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ void File_Wvpk::Data_Parse_Fill()
Fill(Stream_Audio, 0, Audio_Format, "WavPack");
Ztring Version_Minor=Ztring::ToZtring(version%0x100);
if (Version_Minor.size()==1)
Version_Minor.insert(0, 1, __T('0'));
Version_Minor.insert((size_t)0, 1, __T('0'));
Fill(Stream_Audio, 0, Audio_Format_Profile, Ztring::ToZtring(version/0x100)+__T('.')+Version_Minor);
Fill(Stream_Audio, 0, Audio_Codec, "Wavpack");
Fill(Stream_Audio, 0, Audio_BitDepth, Wvpk_Resolution[(resolution1?1:0)*2+(resolution0?1:0)]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ void File__Analyze::Get_VL(const vlc Vlc[], size_t &Info, const char* Name)
if (Trace_Activated)
{
Ztring ToDisplay=Ztring::ToZtring(Value, 2);
ToDisplay.insert(0, CountOfBits-ToDisplay.size(), __T('0'));
ToDisplay.insert((size_t)0, CountOfBits-ToDisplay.size(), __T('0'));
ToDisplay+=__T(" (")+Ztring::ToZtring(CountOfBits)+__T(" bits)");
Param(Name, ToDisplay);
}
Expand Down Expand Up @@ -1508,7 +1508,7 @@ void File__Analyze::Get_VL(vlc_fast &Vlc, size_t &Info, const char* Name)
if (Trace_Activated)
{
Ztring ToDisplay=Ztring::ToZtring(Value, 2);
ToDisplay.insert(0, Vlc.Size-ToDisplay.size(), __T('0'));
ToDisplay.insert((size_t)0, Vlc.Size-ToDisplay.size(), __T('0'));
ToDisplay.resize(Vlc.BitsToSkip[Value]);
ToDisplay+=__T(" (")+Ztring::ToZtring(Vlc.BitsToSkip[Value])+__T(" bits)");
Param(Name, ToDisplay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void File__Analyze::TestContinuousFileNames(size_t CountOfFiles, Ztring FileExte
Pos++;
Ztring Pos_Ztring; Pos_Ztring.From_Number(Pos);
if (Numbers_Size>Pos_Ztring.size())
Pos_Ztring.insert(0, Numbers_Size-Pos_Ztring.size(), __T('0'));
Pos_Ztring.insert((size_t)0, Numbers_Size-Pos_Ztring.size(), __T('0'));
Ztring Next=FileToTest.Path_Get()+PathSeparator+FileToTest_Name+Pos_Ztring+__T('.')+(FileExtension.empty()?FileToTest.Extension_Get():FileExtension);
if (!File::Exists(Next))
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "ZenLib/ZtringListListF.h"
#include "ZenLib/File.h"
#include <algorithm>
#include <ctype.h>
using namespace ZenLib;
using namespace std;
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -2156,9 +2157,13 @@ void MediaInfo_Config::Log_Send (int8u Type, int8u Severity, int32u MessageCode,
Event.Reserved3=(int8u)-1;
Event.MessageCode=MessageCode;
Event.Reserved4=(int32u)-1;
#ifndef WSTRING_MISSING
wstring MessageU=Message.To_Unicode();
#endif // WSTRING_MISSING
string MessageA=Message.To_Local();
#ifndef WSTRING_MISSING
Event.MessageStringU=MessageU.c_str();
#endif // WSTRING_MISSING
Event.MessageStringA=MessageA.c_str();
Event_Send((const int8u*)&Event, sizeof(MediaInfo_Event_Log_0));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "base64.h"
#endif //MEDIAINFO_IBI
#include <algorithm>
#include <ctype.h>
#if MEDIAINFO_DEMUX
#include <cmath>
#endif //MEDIAINFO_DEMUX
Expand Down Expand Up @@ -1737,6 +1738,7 @@ void MediaInfo_Config_MediaInfo::Event_Send (File__Analyze* Source, const int8u*

if (Source==NULL)
{
#if MEDIAINFO_DEMUX
MediaInfo_Event_Generic* Temp=(MediaInfo_Event_Generic*)Data_Content;

if (Demux_Offset_Frame!=(int64u)-1)
Expand All @@ -1760,6 +1762,7 @@ void MediaInfo_Config_MediaInfo::Event_Send (File__Analyze* Source, const int8u*
Temp->PTS-=Demux_Offset_DTS_FromStream;
}
}
#endif //MEDIAINFO_DEMUX
if (File_IgnoreFramesBefore)
{
if (Temp->FrameNumber!=(int64u)-1)
Expand Down Expand Up @@ -1856,7 +1859,7 @@ void MediaInfo_Config_MediaInfo::Event_Send (File__Analyze* Source, const int8u*
Ztring ID;
ID.From_Number(Event->StreamIDs[Pos], 16);
while (ID.size()<Event->StreamIDs_Width[Pos])
ID.insert(0, 1, __T('0'));
ID.insert((size_t)0, 1, __T('0'));
if (ID.size()>Event->StreamIDs_Width[Pos])
ID.erase(0, ID.size()-Event->StreamIDs_Width[Pos]);
File_Name_Final+=__T('.')+ID;
Expand Down Expand Up @@ -1954,13 +1957,21 @@ void MediaInfo_Config_MediaInfo::Event_SubFile_Start(const Ztring &FileName_Abso
Event.StreamIDs_Size=0;

std::string FileName_Relative_Ansi=FileName_Relative.To_UTF8();
#ifndef WSTRING_MISSING
std::wstring FileName_Relative_Unicode=FileName_Relative.To_Unicode();
#endif // WSTRING_MISSING
std::string FileName_Absolute_Ansi=FileName_Absolute.To_UTF8();
#ifndef WSTRING_MISSING
std::wstring FileName_Absolute_Unicode=FileName_Absolute.To_Unicode();
#endif // WSTRING_MISSING
Event.FileName_Relative=FileName_Relative_Ansi.c_str();
#ifndef WSTRING_MISSING
Event.FileName_Relative_Unicode=FileName_Relative_Unicode.c_str();
#endif // WSTRING_MISSING
Event.FileName_Absolute=FileName_Absolute_Ansi.c_str();
#ifndef WSTRING_MISSING
Event.FileName_Absolute_Unicode=FileName_Absolute_Unicode.c_str();
#endif // WSTRING_MISSING

Event_Send(NULL, (const int8u*)&Event, Event.EventSize);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,10 @@ struct MediaInfo_Event_Log_0
MediaInfo_int8u Reserved3;
MediaInfo_int32u MessageCode;
MediaInfo_int32u Reserved4;
#ifndef WSTRING_MISSING
const wchar_t* MessageString;
const wchar_t* MessageStringU;
#endif // WSTRING_MISSING
const char* MessageStringA;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ Ztring MediaInfo_Internal::Xml_Name_Escape (const Ztring &Name)
Ztring ToReturn(Name);

if (ToReturn.operator()(0)>='0' && ToReturn.operator()(0)<='9')
ToReturn.insert(0, 1, __T('_'));
ToReturn.insert((size_t)0, 1, __T('_'));
ToReturn.FindAndReplace(__T(" "), __T("_"), 0, Ztring_Recursive);
ToReturn.FindAndReplace(__T("/"), __T("_"), 0, Ztring_Recursive);
ToReturn.FindAndReplace(__T("("), __T("_"), 0, Ztring_Recursive);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ void MediaInfo_Internal::Entry()
Event.Type=0xC0;
Event.Severity=0xFF;
Event.MessageCode=0;
#ifndef WSTRING_MISSING
Event.MessageStringU=L"Libmms cupport is disabled due to compilation options";
#endif // WSTRING_MISSING
Event.MessageStringA="Libmms cupport is disabled due to compilation options";
MediaInfoLib::Config.Event_Send((const int8u*)&Event, sizeof(MediaInfo_Event_Log_0));
#endif //MEDIAINFO_EVENTS
Expand Down Expand Up @@ -449,7 +451,9 @@ void MediaInfo_Internal::Entry()
Event.Type=0xC0;
Event.Severity=0xFF;
Event.MessageCode=0;
#ifndef WSTRING_MISSING
Event.MessageStringU=L"Libcurl support is disabled due to compilation options";
#endif // WSTRING_MISSING
Event.MessageStringA="Libcurl support is disabled due to compilation options";
MediaInfoLib::Config.Event_Send((const int8u*)&Event, sizeof(MediaInfo_Event_Log_0));
#endif //MEDIAINFO_EVENTS
Expand Down Expand Up @@ -680,7 +684,9 @@ size_t MediaInfo_Internal::Open_Buffer_Init (int64u File_Size_, const String &Fi
Event.StreamIDs_Size=0;
Event.Stream_Size=File_Size_;
Event.FileName=NULL;
#ifndef WSTRING_MISSING
Event.FileName_Unicode=File_Name.c_str();
#endif // WSTRING_MISSING
Config.Event_Send(NULL, (const int8u*)&Event, sizeof(MediaInfo_Event_General_Start_0));
}
#endif //MEDIAINFO_EVENTS
Expand Down Expand Up @@ -738,7 +744,9 @@ size_t MediaInfo_Internal::Open_Buffer_Init (int64u File_Size_, int64u File_Offs
Event.StreamIDs_Size=0;
Event.Stream_Size=File_Size_;
Event.FileName=NULL;
#ifndef WSTRING_MISSING
Event.FileName_Unicode=NULL;
#endif // WSTRING_MISSING
Config.Event_Send(NULL, (const int8u*)&Event, sizeof(MediaInfo_Event_General_Start_0));
}
#endif //MEDIAINFO_EVENTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ void template_generic::Decode()
Ztring Media_Name_Temp(Media_Name);
Ztring Index; Index.From_Number(Index_Pos_Temp);
if (Index.size()<Index_Size)
Index.insert(0, Index_Size-Index.size(), __T('0'));
Index.insert((size_t)0, Index_Size-Index.size(), __T('0'));
Media_Name_Temp.insert(Index_Pos, Index);

Ztring File_Name;
Expand All @@ -385,7 +385,7 @@ void template_generic::Decode()
{
Ztring Index; Index.From_Number(SegmentTimeLines_startNumber);
if (Index.size()<Index_Size)
Index.insert(0, Index_Size-Index.size(), __T('0'));
Index.insert((size_t)0, Index_Size-Index.size(), __T('0'));
Media_Name_Temp.insert(Index_Pos, Index);
if (Time_Pos!=string::npos && Time_Pos>Index_Pos)
Time_Pos_Temp+=Index.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ void File_DvDif::Errors_Stats_Update()
//Frame number
Ztring Frame_Number_Padded=Ztring::ToZtring(Speed_FrameCount-1);
if (Frame_Number_Padded.size()<8)
Frame_Number_Padded.insert(0, 8-Frame_Number_Padded.size(), __T(' '));
Frame_Number_Padded.insert((size_t)0, 8-Frame_Number_Padded.size(), __T(' '));
Errors_Stats_Line+=Frame_Number_Padded;
Errors_Stats_Line+=__T('\t');

Expand Down Expand Up @@ -896,7 +896,7 @@ void File_DvDif::Errors_Stats_Update()
Video_STA_Errors_Count+=Video_STA_Errors[Pos];
Ztring Video_STA_Errors_Count_Padded=Ztring::ToZtring(Video_STA_Errors[Pos]);
if (Video_STA_Errors_Count_Padded.size()<8)
Video_STA_Errors_Count_Padded.insert(0, 8-Video_STA_Errors_Count_Padded.size(), __T(' '));
Video_STA_Errors_Count_Padded.insert((size_t)0, 8-Video_STA_Errors_Count_Padded.size(), __T(' '));
Video_STA_Errors_Details+=Video_STA_Errors_Count_Padded;
Video_STA_Errors_Details+=__T(" \"");
Video_STA_Errors_Details+=Ztring::ToZtring(Pos, 16);
Expand All @@ -910,7 +910,7 @@ void File_DvDif::Errors_Stats_Update()
{
Ztring Video_STA_Errors_Count_Padded=Ztring::ToZtring(((float)Video_STA_Errors_Count)*100/((DSF_IsValid && DSF)?1500:1350)*(QU_FSC?2:1), 2);
if (Video_STA_Errors_Count_Padded.size()<5)
Video_STA_Errors_Count_Padded.insert(0, 5-Video_STA_Errors_Count_Padded.size(), __T(' '));
Video_STA_Errors_Count_Padded.insert((size_t)0, 5-Video_STA_Errors_Count_Padded.size(), __T(' '));
Errors_Stats_Line_Details+=Video_STA_Errors_Count_Padded+__T("%");
Video_STA_Errors_Details.resize(Video_STA_Errors_Details.size()-2);
Errors_Stats_Line_Details+=__T(" (")+Video_STA_Errors_Details+__T(")");
Expand Down Expand Up @@ -946,7 +946,7 @@ void File_DvDif::Errors_Stats_Update()
Audio_Errors_Count+=Audio_Errors[Pos];
Ztring Audio_Errors_Count_Padded=Ztring::ToZtring(Audio_Errors[Pos]);
if (Audio_Errors_Count_Padded.size()<2)
Audio_Errors_Count_Padded.insert(0, 2-Audio_Errors_Count_Padded.size(), __T(' '));
Audio_Errors_Count_Padded.insert((size_t)0, 2-Audio_Errors_Count_Padded.size(), __T(' '));
Audio_Errors_Details+=Audio_Errors_Count_Padded;
Audio_Errors_Details+=__T(" Dseq=");
Audio_Errors_Details+=Ztring::ToZtring(Pos, 16);
Expand Down Expand Up @@ -976,7 +976,7 @@ void File_DvDif::Errors_Stats_Update()

Ztring Audio_Errors_Count_Padded=Ztring::ToZtring(((float)Audio_Errors_Count)*100/((DSF_IsValid && DSF)?54:45)*(QU_FSC?2:1), 2);
if (Audio_Errors_Count_Padded.size()<2)
Audio_Errors_Count_Padded.insert(0, 2-Audio_Errors_Count_Padded.size(), __T(' '));
Audio_Errors_Count_Padded.insert((size_t)0, 2-Audio_Errors_Count_Padded.size(), __T(' '));
if (ErrorsAreAlreadyDetected)
Errors_Stats_Line_Details+=__T(", ");
if (Audio_Errors_Count<(size_t)((QU_System?6:5)*9))
Expand Down Expand Up @@ -1322,7 +1322,7 @@ void File_DvDif::Errors_Stats_Update_Finnish()
Errors_Count+=Video_STA_Errors_Total[Pos];
Ztring Errors_Count_Padded=Ztring::ToZtring(Video_STA_Errors_Total[Pos]);
if (Errors_Count_Padded.size()<8)
Errors_Count_Padded.insert(0, 8-Errors_Count_Padded.size(), __T(' '));
Errors_Count_Padded.insert((size_t)0, 8-Errors_Count_Padded.size(), __T(' '));
Errors_Details+=Errors_Count_Padded;
Errors_Details+=__T(" \"");
Errors_Details+=Ztring::ToZtring(Pos, 16);
Expand All @@ -1334,7 +1334,7 @@ void File_DvDif::Errors_Stats_Update_Finnish()
Errors_Stats_End_Lines+=__T("Total video error concealment: ");
Ztring Errors_Count_Padded=Ztring::ToZtring(Errors_Count);
if (Errors_Count_Padded.size()<8)
Errors_Count_Padded.insert(0, 8-Errors_Count_Padded.size(), __T(' '));
Errors_Count_Padded.insert((size_t)0, 8-Errors_Count_Padded.size(), __T(' '));
Errors_Stats_End_Lines+=__T(" ")+Errors_Count_Padded+__T(" errors");
Errors_Details.resize(Errors_Details.size()-2);
Errors_Stats_End_Lines+=__T(" (")+Errors_Details+__T(")")+__T('&');
Expand All @@ -1358,7 +1358,7 @@ void File_DvDif::Errors_Stats_Update_Finnish()
Errors_Count+=Audio_Errors_Total[Channel][Pos];
Ztring Errors_Count_Padded=Ztring::ToZtring(Audio_Errors_Total[Channel][Pos]);
if (Errors_Count_Padded.size()<8)
Errors_Count_Padded.insert(0, 8-Errors_Count_Padded.size(), __T(' '));
Errors_Count_Padded.insert((size_t)0, 8-Errors_Count_Padded.size(), __T(' '));
Errors_Details+=Errors_Count_Padded;
Errors_Details+=__T(" Dseq=");
Errors_Details+=Ztring::ToZtring(Pos, 16);
Expand All @@ -1370,7 +1370,7 @@ void File_DvDif::Errors_Stats_Update_Finnish()
Errors_Stats_End_Lines+=__T("Total audio error code for CH")+Ztring::ToZtring(Channel+1)+__T(": ");
Ztring Errors_Count_Padded=Ztring::ToZtring(Errors_Count);
if (Errors_Count_Padded.size()<8)
Errors_Count_Padded.insert(0, 8-Errors_Count_Padded.size(), __T(' '));
Errors_Count_Padded.insert((size_t)0, 8-Errors_Count_Padded.size(), __T(' '));
Errors_Stats_End_Lines+=__T(" ")+Errors_Count_Padded+__T(" errors");
Errors_Details.resize(Errors_Details.size()-2);
Errors_Stats_End_Lines+=__T(" (")+Errors_Details+__T(")")+__T('&');
Expand Down Expand Up @@ -1471,14 +1471,14 @@ void File_DvDif::Errors_Stats_Update_Finnish()
int64u Start=Pos?Speed_TimeStampsZ[Pos-1].Last.FramePos:0;
Ztring Start_Padded=Ztring::ToZtring(Start);
if (Start_Padded.size()<8)
Start_Padded.insert(0, 8-Start_Padded.size(), __T(' '));
Start_Padded.insert((size_t)0, 8-Start_Padded.size(), __T(' '));

Errors_Stats_End_Lines+=Start_Padded;

int64u End=Speed_TimeStampsZ[Pos].Last.FramePos-1;
Ztring End_Padded=Ztring::ToZtring(End);
if (End_Padded.size()<8)
End_Padded.insert(0, 8-End_Padded.size(), __T(' '));
End_Padded.insert((size_t)0, 8-End_Padded.size(), __T(' '));
Errors_Stats_End_Lines+=__T(" - ")+End_Padded;

Errors_Stats_End_Lines+=__T('&');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,19 @@ void File_Ibi::CompressedIndex()

//Uncompressing
int8u* Dest;
#ifdef __EXCEPTIONS
try
#else
if (true)
#endif
{
Dest=new int8u[Dest_Size];
}
#ifdef __EXCEPTIONS
catch (...)
#else
if (false)
#endif
{
//Memory error
Reject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ void File_Mpeg_Descriptors::Descriptor_05()
{
Ztring Temp; Temp.From_Number(format_identifier, 16);
if (Temp.size()<8)
Temp.insert(0, 8-Temp.size(), __T('0'));
Temp.insert((size_t)0, 8-Temp.size(), __T('0'));
Complete_Stream->Streams[elementary_PID]->Infos["format_identifier"]=__T("0x")+Temp;
}
Complete_Stream->Streams[elementary_PID]->Infos_Option["format_identifier"]=__T("N NT");
Expand Down
Loading

0 comments on commit 7e0c213

Please sign in to comment.