Skip to content

Commit

Permalink
* r503 release sp build-19472
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-pimenov committed Feb 11, 2016
1 parent 91f52b8 commit 246c4db
Show file tree
Hide file tree
Showing 259 changed files with 12,841 additions and 5,358 deletions.
4 changes: 2 additions & 2 deletions FlyFeatures/AutoUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void AutoUpdate::startUpdateThisThread()
#ifdef IRAINMAN_AUTOUPDATE_ALL_USERS_DATA
unique_ptr<AutoUpdateObject> autoUpdateObjectAU(new AutoUpdateObject());
#endif
const string& serverURL = getAUTOUPDATE_SERVER_URL();
const string serverURL = getAUTOUPDATE_SERVER_URL();
string l_base_update_url;
string l_base_updateAU_url;
if (Util::isHttpLink(serverURL))
Expand Down Expand Up @@ -868,7 +868,7 @@ const string& AutoUpdate::UPDATE_DESCRIPTION()
return BOOLSETTING(AUTOUPDATE_TO_BETA) ? UPDATE_DESCRIPTION_B : UPDATE_DESCRIPTION_R;
}

const string& AutoUpdate::getAUTOUPDATE_SERVER_URL()
string AutoUpdate::getAUTOUPDATE_SERVER_URL()
{
// SSA - get custom URL if need
const string& l_customUpdateServerUrl = SETTING(AUTOUPDATE_SERVER_URL);
Expand Down
2 changes: 1 addition & 1 deletion FlyFeatures/AutoUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class AutoUpdate :
static const string& UPDATE_FILEDOWNLOAD();
static const string& UPDATE_SIGNFILEDOWNLOAD();
static const string& UPDATE_DESCRIPTION();
static const string& getAUTOUPDATE_SERVER_URL();
static string getAUTOUPDATE_SERVER_URL();
static AutoUpdateFile parseNode(const XMLParser::XMLNode& Node);
int64_t checkFilesToNeedsUpdate(AutoUpdateFiles& p_files4Update,
AutoUpdateFiles& p_files4Description,
Expand Down
2 changes: 1 addition & 1 deletion MakeDefs/MakeDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int __cdecl main(int argc, char* argv[])
ex.addChildAttrib("Revision", string("1"));
ex.stepIn();
*/
ex.addTag("recources");
ex.addTag("resources");
ex.stepIn();
string name;
string def;
Expand Down
4 changes: 4 additions & 0 deletions MediaInfoLib/History_DLL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ bug reports and feature request are here:
https://sourceforge.net/p/mediainfo/_list/tickets


Version 0.7.83, 2016-
--------------
+ MPEG-TS: ATSC Modulation Mode (Analog, SCTE_mode_1 aka 64-QAM, SCTE_mode_2 aka 256-QAM, 8-VSB, 16-VSB)

Version 0.7.82, 2016-01-27
--------------
+ Matroska: CRC-32 validation
Expand Down
23 changes: 13 additions & 10 deletions MediaInfoLib/Source/MediaInfo/Multiple/File_Mk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1402,9 +1402,7 @@ void File_Mk::CRC32()
Get_L4(CRC32Compute[Element_Level-1].Expected, "Value");

{
#if MEDIAINFO_TRACE
Param_Info(__T("Not tested ") + Ztring::ToZtring(Element_Level - 1) + __T(' ') + Ztring::ToZtring(CRC32Compute[Element_Level - 1].Expected));
#endif
Param_Info1(__T("Not tested ")+Ztring::ToZtring(Element_Level-1)+__T(' ')+Ztring::ToZtring(CRC32Compute[Element_Level-1].Expected));
CRC32Compute[Element_Level-1].Computed=0xFFFFFFFF;
CRC32Compute[Element_Level-1].Pos = File_Offset + Buffer_Offset;
CRC32Compute[Element_Level-1].From = File_Offset + Buffer_Offset + Element_Size;
Expand Down Expand Up @@ -2072,7 +2070,7 @@ void File_Mk::Segment_Cluster_BlockGroup_Block()
if (Stream[TrackNumber].Searching_Payload)
{
Element_Begin1("Data");
Element_Parser(Stream[TrackNumber].Parser->ParserName.To_UTF8().c_str());
Element_Parser(Stream[TrackNumber].Parser->ParserName.To_UTF8().c_str());

Element_Code=TrackNumber;

Expand Down Expand Up @@ -4200,16 +4198,17 @@ void File_Mk::JumpTo (int64u GoToValue)
{
//Searching and replacing CRC-32 information
//TODO: better implementation without this ugly hack
#if MEDIAINFO_TRACE
Ztring &TraceData = Details_Get(i);
#if MEDIAINFO_TRACE
Ztring &TraceData = Details_Get(i);
Ztring ToSearch=__T("Not tested ")+Ztring::ToZtring(i)+__T(' ')+Ztring::ToZtring(CRC32Compute[i].Expected);
size_t Pos = TraceData.find(ToSearch);
if (Pos != string::npos)
{
TraceData.erase(Pos, ToSearch.size());
TraceData.insert(Pos, __T("Not tested"));
}
#endif
#endif //MEDIAINFO_TRACE

CRC32Compute[i].UpTo=0;
}
CRC32Compute.clear();
Expand All @@ -4225,11 +4224,13 @@ void File_Mk::JumpTo (int64u GoToValue)
//TODO: if trace is not activated and CRC-32 is present, we don't need to parse all elements, we only need to do the CRC-32 check
void File_Mk::TestMultipleInstances (size_t* Instances)
{
#if MEDIAINFO_TRACE
bool ParseAll=false;
#if MEDIAINFO_TRACE
if (Trace_Activated)
if (Trace_Activated)
ParseAll=true;
#endif
#else //MEDIAINFO_TRACE
static bool ParseAll = false;
#endif //MEDIAINFO_TRACE
if (!ParseAll && Config->ParseSpeed >= 1.0)
{
//Probing, checking if CRC-32 is present
Expand All @@ -4238,8 +4239,10 @@ void File_Mk::TestMultipleInstances (size_t* Instances)
Element_WaitForMoreData();
return;
}
#if MEDIAINFO_TRACE
if (Buffer[Buffer_Offset] == 0xBF) //CRC-32 element
ParseAll=true;
#endif //MEDIAINFO_TRACE
}

if ((!Instances || *Instances) && !ParseAll)
Expand Down
27 changes: 22 additions & 5 deletions MediaInfoLib/Source/MediaInfo/Multiple/File_MpegTs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,10 @@ void File_MpegTs::Streams_Update_Duration_Update()
int64u TimeStamp_HasProblems=0;
#endif // MEDIAINFO_ADVANCED

int64u Duration_Count=0;
int64u Duration_Max=0;
int64u Duration_Sum=0;
int64u Bytes_Sum=0;
for (std::map<int16u, int16u>::iterator PCR_PID=Complete_Stream->PCR_PIDs.begin(); PCR_PID!=Complete_Stream->PCR_PIDs.end(); ++PCR_PID)
{
complete_stream::streams::iterator Stream=Complete_Stream->Streams.begin()+PCR_PID->first;
Expand Down Expand Up @@ -1182,11 +1186,11 @@ void File_MpegTs::Streams_Update_Duration_Update()
}
Bytes=(*Stream)->TimeStamp_End_Offset-(*Stream)->TimeStamp_Start_Offset;

if (Duration && Bytes)
{
Fill(Stream_General, 0, General_Duration, ((float64)Duration)/27000, 6, true);
Fill(Stream_General, 0, General_OverallBitRate, Bytes*8/(((float64)Duration)/27000000), 0, true);
}
if (Duration>Duration_Max)
Duration_Max=Duration;
Duration_Count++;
Duration_Sum+=Duration;
Bytes_Sum+=Bytes;

(*Stream)->TimeStamp_End_IsUpdated=false;
(*Stream)->IsPCR_Duration=(float64)Duration;
Expand Down Expand Up @@ -1231,6 +1235,19 @@ void File_MpegTs::Streams_Update_Duration_Update()
}
}

if (Duration_Max)
Fill(Stream_General, 0, General_Duration, ((float64)Duration_Max) / 27000, 6, true);
if (Duration_Count && Duration_Sum && Bytes_Sum)
{
//Filling Duration and bitrate with an average of content from all streams with PCR
//Min and Max are based on a a 1 byte precision in the computed byte count + +/- 500 ns tolerance for hte PCR vale
Fill(Stream_General, 0, General_OverallBitRate, Bytes_Sum * 8 / (((float64)Duration_Sum) / 27000000), 0, true);
Fill(Stream_General, 0, "OverallBitRate_Precision_Min", (Bytes_Sum - Duration_Count) * 8 / (((float64)(Duration_Sum + 13500 * Duration_Count)) / 27000000), 0, true);
(*Stream_More)[Stream_General][0](Ztring().From_Local("OverallBitRate_Precision_Min"), Info_Options) = __T("N NT");
Fill(Stream_General, 0, "OverallBitRate_Precision_Max", (Bytes_Sum + Duration_Count) * 8 / (((float64)(Duration_Sum - 13500 * Duration_Count)) / 27000000), 0, true);
(*Stream_More)[Stream_General][0](Ztring().From_Local("OverallBitRate_Precision_Max"), Info_Options) = __T("N NT");
}

if (IsVbr)
Fill(Stream_General, 0, General_OverallBitRate_Mode, "VBR", Unlimited, true, true);
else if (IsCbr)
Expand Down
22 changes: 19 additions & 3 deletions MediaInfoLib/Source/MediaInfo/Multiple/File_Mpeg_Psi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,20 @@ const char* Mpeg_Psi_atsc_service_type(int8u service_type)
}
}

//---------------------------------------------------------------------------
string Mpeg_Psi_atsc_modulation_mode(int8u modulation_mode)
{
switch (modulation_mode)
{
case 0x01 : return "Analog";
case 0x02 : return "SCTE_mode_1";
case 0x03 : return "SCTE_mode_2";
case 0x04 : return "ATSC (8 VSB)";
case 0x05 : return "ATSC (16 VSB)";
default : return Ztring::ToZtring(modulation_mode).To_UTF8();
}
}

//---------------------------------------------------------------------------
const char* Mpeg_Psi_table_id_extension(int8u table_id)
{
Expand Down Expand Up @@ -1816,7 +1830,7 @@ void File_Mpeg_Psi::Table_C9()
for (int8u Pos=0; Pos<num_channels_in_section; Pos++)
{
int16u major_channel_number, minor_channel_number, source_id;
int8u service_type;
int8u service_type, modulation_mode;
Element_Begin0();
Get_UTF16B(table_id==0xDA?16:14, short_name, "short_name"); //8 chars for satellite, else 7 chars
BS_Begin();
Expand All @@ -1825,7 +1839,7 @@ void File_Mpeg_Psi::Table_C9()
Get_S2 (10, minor_channel_number, "minor_channel_number");
if (table_id==0xDA) //Satellite
{
Skip_S1( 6, "modulation_mode");
Get_S1 ( 6, modulation_mode, "modulation_mode");
Skip_S4(32, "carrier_frequency");
Skip_S4(32, "carrier_symbol_rate");
Skip_S1( 2, "polarization");
Expand All @@ -1835,7 +1849,7 @@ void File_Mpeg_Psi::Table_C9()
else //Terrestrial and Cable
{
BS_End();
Skip_B1( "modulation_mode");
Get_B1 (modulation_mode, "modulation_mode");
Skip_B4( "carrier_frequency");
}
Skip_B2( "channel_TSID");
Expand Down Expand Up @@ -1885,6 +1899,8 @@ void File_Mpeg_Psi::Table_C9()
Complete_Stream->Transport_Streams[table_id_extension].Programs[program_number].source_id=source_id;
Complete_Stream->Transport_Streams[table_id_extension].Programs[program_number].source_id_IsValid=true;
}
if (modulation_mode)
Complete_Stream->Transport_Streams[table_id_extension].Programs[program_number].Infos["ModulationMode"].From_UTF8(Mpeg_Psi_atsc_modulation_mode(modulation_mode).c_str());
FILLING_END();

//Descriptors
Expand Down
8 changes: 6 additions & 2 deletions MediaInfoLib/Source/MediaInfo/Video/File_Avc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1929,6 +1929,7 @@ void File_Avc::slice_header()
Element_Info1(__T("Offset of ")+Ztring::ToZtring(ToInsert));
TemporalReferences.insert(TemporalReferences.begin()+Base, ToInsert, NULL);
TemporalReferences_Offset+=ToInsert;
TemporalReferences_Offset_pic_order_cnt_lsb_Last += ToInsert;
TemporalReferences_Max+=ToInsert;
TemporalReferences_pic_order_cnt_Min=pic_order_cnt;
}
Expand All @@ -1951,6 +1952,7 @@ void File_Avc::slice_header()
{
TemporalReferences_Offset+=TemporalReferences_Reserved;
pic_order_cnt-=TemporalReferences_Reserved;
TemporalReferences_pic_order_cnt_Min-=TemporalReferences_Reserved/2;
switch ((*seq_parameter_set_Item)->pic_order_cnt_type)
{
case 0 :
Expand All @@ -1962,8 +1964,6 @@ void File_Avc::slice_header()
default:;
}
}
else if (Offset && Offset<=2) //Only I-frames
TemporalReferences_Offset+=2;
while (TemporalReferences_Offset+pic_order_cnt>=3*TemporalReferences_Reserved)
{
for (size_t Pos=0; Pos<TemporalReferences_Reserved; Pos++)
Expand Down Expand Up @@ -1996,6 +1996,10 @@ void File_Avc::slice_header()
TemporalReferences_Max-=TemporalReferences_Reserved;
else
TemporalReferences_Max=0;
if (TemporalReferences_Reserved<TemporalReferences_Offset_pic_order_cnt_lsb_Last)
TemporalReferences_Offset_pic_order_cnt_lsb_Last-=TemporalReferences_Reserved;
else
TemporalReferences_Offset_pic_order_cnt_lsb_Last=0;
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/BufferedSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class BufferedSocket : public Speaker<BufferedSocketListener>, private BASE_THRE
{
return hasSocket() ? sock->getCipherName() : Util::emptyString;
}
const string& getIp() const
string getIp() const
{
return hasSocket() ? sock->getIp() : Util::emptyString;
}
Expand Down
12 changes: 8 additions & 4 deletions client/CFlyLockProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ void CFlyLockProfiler::log(const char* p_path, int p_recursion_count, bool p_is_
if (p_is_unlock && m_function)
{
BoostFastLock l(g_cs_stat_map);
auto& l_item = g_lock_map[m_function];
auto& l_item = g_lock_map[m_function + string(" Line:") + Util::toString(m_line)];
l_item.first++;
if (l_tick_delta > l_item.second)
l_item.second = l_tick_delta;
}
if (
#define FLYLINKDC_USE_PROFILE_SELECTED_CLASS
#ifdef FLYLINKDC_USE_PROFILE_SELECTED_CLASS
(l_tick_delta > 16 &&
(l_tick_delta >= 200 &&
(m_function &&
(
true // strstr(m_function, "Identity") != 0
Expand All @@ -38,10 +38,13 @@ void CFlyLockProfiler::log(const char* p_path, int p_recursion_count, bool p_is_
(m_function &&
(
strstr(m_function, "DebugManager::") == 0 &&

strstr(m_function, "ShareManager::") == 0 &&
strstr(m_function, "::addListener") == 0 &&
strstr(m_function, "::removeListener") == 0 &&
strstr(m_function, "TaskQueue::add") == 0 &&
strstr(m_function, "Identity::") == 0 &&
strstr(m_function, "LogManager::") == 0

)
)
)
Expand All @@ -68,10 +71,11 @@ void CFlyLockProfiler::log(const char* p_path, int p_recursion_count, bool p_is_
time(&now);
tm *now_tm = localtime(&now);
strftime(timeFormat, _countof(timeFormat), "%d.%m.%Y %H:%M:%S", now_tm);
fprintf(f, "[%6d][%s] %s tick_delta = %d RecursionCount = %d ext_info = %s\r\n",
fprintf(f, "[%6d][%s] %s [%d] tick_delta = %d RecursionCount = %d ext_info = %s\r\n",
::GetCurrentThreadId(),
timeFormat,
m_function ? m_function : "",
m_line,
//l_delta,
l_tick_delta,
p_recursion_count,
Expand Down
3 changes: 2 additions & 1 deletion client/CFlyLockProfiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CFlyLockProfiler
#endif
{
public:
explicit CFlyLockProfiler(const char* p_function = nullptr) : m_function(p_function)
explicit CFlyLockProfiler(const char* p_function, int p_line) : m_function(p_function), m_line(p_line)
{
//QueryPerformanceCounter(&m_start);
m_start_tick = GetTickCount();
Expand All @@ -35,6 +35,7 @@ class CFlyLockProfiler
void log(const char* p_path, int p_recursion_count, bool p_is_unlock = false);
private:
const char* m_function;
int m_line;
//LARGE_INTEGER m_start;
DWORD m_start_tick;
static BoostFastCriticalSection g_cs_stat_map;
Expand Down
2 changes: 2 additions & 0 deletions client/CFlyProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#define css_totals_row "<tr class=\"header\"><td class=\"left\">Function</td><td>Calls</td><td>Self MCycles</td><td class=\"right\">Self Avg</td></tr>\n"

#if defined(_WIN32)
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#define copystring _strdup
#include <windows.h>
#else
Expand Down
11 changes: 6 additions & 5 deletions client/CFlyThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,12 @@ template<class T> class LockBase
public:
explicit LockBase(T& aCs
#ifdef FLYLINKDC_USE_PROFILER_CS
, const char* p_function = nullptr
, const char* p_function
, int p_line
#endif
) : cs(aCs)
#ifdef FLYLINKDC_USE_PROFILER_CS
, CFlyLockProfiler(p_function)
, CFlyLockProfiler(p_function, p_line)
#endif
{
cs.lock();
Expand All @@ -579,8 +580,8 @@ template<class T> class LockBase
};
typedef LockBase<CriticalSection> Lock;
#ifdef FLYLINKDC_USE_PROFILER_CS
#define CFlyLock(cs) Lock l_lock(cs,__FUNCTION__);
#define CFlyLockLine(cs, line) Lock l_lock(cs,line);
#define CFlyLock(cs) Lock l_lock(cs,__FUNCTION__, __LINE__);
#define CFlyLockLine(cs, line) Lock l_lock(cs,line,0);
#else
#define CFlyLock(cs) Lock l_lock(cs);
#endif
Expand All @@ -591,7 +592,7 @@ typedef Lock FastLock;
#endif // IRAINMAN_USE_SPIN_LOCK

#ifdef FLYLINKDC_USE_PROFILER_CS
#define CFlyFastLock(cs) FastLock l_lock(cs,__FUNCTION__);
#define CFlyFastLock(cs) FastLock l_lock(cs,__FUNCTION__,__LINE__);
#else
#define CFlyFastLock(cs) FastLock l_lock(cs);
#endif
Expand Down
9 changes: 6 additions & 3 deletions client/CFlylinkDBManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,15 +1532,18 @@ bool CFlylinkDBManager::find_cache_location(uint32_t p_ip, uint32_t& p_location_
return false;
}
//========================================================================================================
void CFlylinkDBManager::get_country_and_location(uint32_t p_ip, uint16_t& p_country_index, uint32_t& p_location_index)
void CFlylinkDBManager::get_country_and_location(uint32_t p_ip, uint16_t& p_country_index, uint32_t& p_location_index, bool p_is_use_only_cache)
{
dcassert(p_ip);
uint16_t l_flag_location_index = 0; // TODO ?
const bool l_is_find_country = Util::isPrivateIp(p_ip) || find_cache_country(p_ip, p_country_index);
const bool l_is_find_location = find_cache_location(p_ip, p_location_index, l_flag_location_index);
if (l_is_find_country == false || l_is_find_location == false)
if (p_is_use_only_cache == false)
{
load_country_locations_p2p_guard_from_db(p_ip, p_location_index, p_country_index);
if (l_is_find_country == false || l_is_find_location == false)
{
load_country_locations_p2p_guard_from_db(p_ip, p_location_index, p_country_index);
}
}
}
//========================================================================================================
Expand Down
Loading

0 comments on commit 246c4db

Please sign in to comment.