Skip to content

Commit

Permalink
* r504 release sp build-20648
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-pimenov committed Apr 13, 2017
1 parent 66caf85 commit e1aaa85
Show file tree
Hide file tree
Showing 133 changed files with 11,404 additions and 16,119 deletions.
4 changes: 1 addition & 3 deletions FlyFeatures/flyServer.cpp
Expand Up @@ -33,9 +33,7 @@
#include "../client/IpGuard.h"
#include "../windows/ChatBot.h"

#include "../jsoncpp/include/json/value.h"
#include "../jsoncpp/include/json/reader.h"
#include "../jsoncpp/include/json/writer.h"
#include "../jsoncpp/include/json/json.h"
#include "../MediaInfoLib/Source/MediaInfo/MediaInfo_Const.h"
#include "../MediaInfoLib/Source/MediaInfo/MediaInfo.h"
#include "../MediaInfoLib/Source/MediaInfo/MediaInfo_Config.h"
Expand Down
14 changes: 7 additions & 7 deletions MediaInfoLib/Source/MediaInfo/File__Analyze_Streams.cpp
Expand Up @@ -320,9 +320,9 @@ void File__Analyze::Fill (stream_t StreamKind, size_t StreamPos, size_t Paramete
break;
}

const Ztring Parameter_String = Ztring::ToZtring(Parameter);
if (Replace)
{
Ztring Parameter_String=Ztring::ToZtring(Parameter);
for (size_t Pos=0; Pos<Fill_Temp[StreamKindS].size(); Pos++)
if (Fill_Temp[StreamKindS][Pos].Parameter==Parameter_String)
{
Expand All @@ -331,7 +331,7 @@ void File__Analyze::Fill (stream_t StreamKind, size_t StreamPos, size_t Paramete
}
}
fill_temp_item NewList;
NewList.Parameter=Ztring::ToZtring(Parameter);
NewList.Parameter=Parameter_String;
NewList.Value=Value;
Fill_Temp[StreamKindS].push_back(NewList);
return; //No streams
Expand Down Expand Up @@ -961,26 +961,26 @@ void File__Analyze::Fill (const stream_t StreamKind, const size_t StreamPos, con
break;
}

const Ztring Parameter_String_UTF8 = Ztring().From_UTF8(Parameter);
if (Replace)
{
Ztring Parameter_String=Ztring().From_UTF8(Parameter);
for (size_t Pos=0; Pos<Fill_Temp[StreamKindS].size(); Pos++)
if (Fill_Temp[StreamKindS][Pos].Parameter==Parameter_String)
if (Fill_Temp[StreamKindS][Pos].Parameter== Parameter_String_UTF8)
{
Fill_Temp[StreamKindS][Pos].Value=Value;
return;
}
}
fill_temp_item NewList;
NewList.Parameter=Ztring().From_UTF8(Parameter);
NewList.Parameter= Parameter_String_UTF8;
NewList.Value=Value;
Fill_Temp[StreamKindS].push_back(NewList);
return; //No streams
}

//Handling of well known parameters
const Ztring ParameterLocal = Ztring().From_Local(Parameter);
size_t Pos=MediaInfoLib::Config.Info_Get(StreamKind).Find(ParameterLocal);
const size_t Pos=MediaInfoLib::Config.Info_Get(StreamKind).Find(ParameterLocal);
if (Pos!=Error)
{
Fill(StreamKind, StreamPos, Pos, Value, Replace);
Expand Down Expand Up @@ -1035,7 +1035,7 @@ void File__Analyze::Fill_SetOptions(stream_t StreamKind, size_t StreamPos, const
}

//Handling of well known parameters
size_t Pos=MediaInfoLib::Config.Info_Get(StreamKind).Find(Ztring().From_Local(Parameter));
const size_t Pos=MediaInfoLib::Config.Info_Get(StreamKind).Find(Ztring().From_Local(Parameter));
if (Pos!=Error)
{
//We can not change that
Expand Down
6 changes: 4 additions & 2 deletions MediaInfoLib/Source/MediaInfo/MediaInfo_Inform.cpp
Expand Up @@ -647,7 +647,7 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
Elements(0)=Elements(0).SubString(__T("%"), __T("%"));

//Test if there is something to replace
size_t Pos=MediaInfoLib::Config.Info_Get(StreamKind).Find(Elements(0));
const size_t Pos=MediaInfoLib::Config.Info_Get(StreamKind).Find(Elements(0));
if (Pos!=std::string::npos)
{
if (Info(Pos).size()>0)
Expand Down Expand Up @@ -703,7 +703,9 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
while (Retour.find(__T('%'), PosX)!=(size_t)-1)
{
PosX=Retour.find(__T('%'), PosX);
if (Retour.size() > PosX + 2 && Retour[PosX + 1] >= __T('A') && Retour[PosX + 1] <= __T('Z')) //To keep out "%" without any signification
if (Retour.size() > PosX + 2
&& ((Retour[PosX + 1] >= __T('a') && Retour[PosX + 1] <= __T('z'))
|| (Retour[PosX + 1] >= __T('A') && Retour[PosX + 1] <= __T('Z')))) //To keep out "%" without any signification
{
Ztring ARemplacer = Ztring(__T("%") + Retour.SubString(__T("%"), __T("%"), PosX)) + __T("%");
Ztring RemplacerPar = Get(StreamKind, StreamPos, Retour.SubString(__T("%"), __T("%"), PosX));
Expand Down
2 changes: 1 addition & 1 deletion MediaInfoLib/Source/MediaInfo/MediaInfo_Internal.cpp
Expand Up @@ -1142,7 +1142,7 @@ Ztring MediaInfo_Internal::Get(stream_t StreamKind, size_t StreamPos, const Stri
CS.Leave();
Ztring InformZtring=Inform(StreamKind, StreamPos, true);
CS.Enter();
size_t Pos=MediaInfoLib::Config.Info_Get(StreamKind).Find(__T("Inform"));
const size_t Pos=MediaInfoLib::Config.Info_Get(StreamKind).Find(__T("Inform"));
if (Pos!=Error)
Stream[StreamKind][StreamPos](Pos)=InformZtring;
}
Expand Down
7 changes: 5 additions & 2 deletions MediaInfoLib/Source/MediaInfo/Multiple/File_MpegPs.cpp
Expand Up @@ -323,7 +323,7 @@ void File_MpegPs::Streams_Fill()
//---------------------------------------------------------------------------
void File_MpegPs::Streams_Fill_PerStream(size_t StreamID, ps_stream &Temp, kindofstream KindOfStream)
{
size_t Counts[Stream_Max];
size_t Counts[Stream_Max+1]; // TODO https://github.com/MediaArea/MediaInfoLib/issues/467
for (size_t StreamKind=Stream_General+1; StreamKind<Stream_Max; StreamKind++)
Counts[StreamKind]=Count_Get((stream_t)StreamKind);

Expand Down Expand Up @@ -2410,7 +2410,10 @@ void File_MpegPs::pack_start()
{
#endif //MEDIAINFO_TRACE
//Parsing
Version=Buffer[Buffer_Pos]>>6;
if(Buffer_Pos< Buffer_Size) // https://github.com/MediaArea/MediaInfoLib/issues/471
Version=Buffer[Buffer_Pos]>>6;
else
Version=0;
#if MEDIAINFO_TRACE
}
#endif //MEDIAINFO_TRACE
Expand Down
2 changes: 1 addition & 1 deletion MediaInfoLib/Source/MediaInfo/Reader/Reader_File.cpp
Expand Up @@ -373,7 +373,7 @@ size_t Reader_File::Format_Test_PerParser_Continue (MediaInfo_Internal* MI)
if (MI->IsTerminating())
return 1; //Termination is requested
#endif //FLYLINKDC_ZENLIB_USE_THREAD
if (Status[File__Analyze::IsFinished] || CountOfSeconds>=(size_t)MI->Config.File_GrowingFile_Delay_Get() || (StopAfterFilled && Status[File__Analyze::IsFilled]))
if (Status[File__Analyze::IsFinished] || MI->Config.IsFinishing || (StopAfterFilled && Status[File__Analyze::IsFilled]))
ShouldContinue=false;
}
#endif //MEDIAINFO_DEMUX
Expand Down
5 changes: 4 additions & 1 deletion MediaInfoLib/Source/MediaInfo/Video/File_Avc.cpp
Expand Up @@ -3276,14 +3276,15 @@ void File_Avc::seq_parameter_set()
if (Null)
Trusted_IsNot("Should be NULL byte");
}

bool use_Data_Item_New = false;
FILLING_BEGIN_PRECISE();
//NextCode
NextCode_Clear();
NextCode_Add(0x08);

//Add
seq_parameter_set_data_Add(seq_parameter_sets, seq_parameter_set_id, Data_Item_New);
use_Data_Item_New = true;

//Autorisation of other streams
Streams[0x08].Searching_Payload=true; //pic_parameter_set
Expand All @@ -3296,6 +3297,8 @@ void File_Avc::seq_parameter_set()
if (Streams[0x07].ShouldDuplicate)
Streams[0x0B].ShouldDuplicate=true; //end_of_stream
FILLING_END();
if (use_Data_Item_New==false)
delete Data_Item_New;
}

void File_Avc::seq_parameter_set_data_Add(std::vector<seq_parameter_set_struct*> &Data, const int32u Data_id, seq_parameter_set_struct* Data_Item_New)
Expand Down

0 comments on commit e1aaa85

Please sign in to comment.