Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Subtitles/STS.cpp18
-rw-r--r--src/apps/SubResync/SubResync.cpp2
-rw-r--r--src/apps/SubResync/SubResync.rc48
-rw-r--r--src/apps/SubResync/SubResync.vcproj2
-rw-r--r--src/apps/SubResync/SubResyncDlg.cpp4
-rw-r--r--src/apps/SubResync/SubResyncDlg.h2
-rw-r--r--src/apps/VSConv/VSConv.rc56
-rw-r--r--src/apps/VSConv/VSConv_2010.sln4
-rw-r--r--src/apps/mplayerc/Changelog.txt6
-rw-r--r--src/apps/mplayerc/FGFilter.cpp26
-rw-r--r--src/apps/mplayerc/FakeFilterMapper2.cpp4
-rw-r--r--src/apps/mplayerc/FloatEdit.cpp2
-rw-r--r--src/apps/mplayerc/MainFrm.cpp230
-rw-r--r--src/apps/mplayerc/PPageAccelTbl.cpp6
-rw-r--r--src/apps/mplayerc/PPageBase.cpp4
-rw-r--r--src/apps/mplayerc/PPageFileInfoDetails.cpp2
-rw-r--r--src/apps/mplayerc/PPageFileMediaInfo.cpp2
-rw-r--r--src/apps/mplayerc/PPageFormats.cpp2
-rw-r--r--src/apps/mplayerc/PPageFullscreen.cpp12
-rw-r--r--src/apps/mplayerc/PPagePlayback.cpp18
-rw-r--r--src/apps/mplayerc/PPagePlayback.h2
-rw-r--r--src/apps/mplayerc/PPagePlayer.cpp18
-rw-r--r--src/apps/mplayerc/PPagePlayer.h2
-rw-r--r--src/apps/mplayerc/PlayerCaptureDialog.cpp18
-rw-r--r--src/apps/mplayerc/PlayerListCtrl.cpp16
-rw-r--r--src/apps/mplayerc/PlayerNavigationDialog.cpp2
-rw-r--r--src/apps/mplayerc/PlayerPlaylistBar.cpp10
-rw-r--r--src/apps/mplayerc/PlayerSubresyncBar.cpp24
-rw-r--r--src/apps/mplayerc/Playlist.cpp2
-rw-r--r--src/apps/mplayerc/ShaderEditorDlg.cpp10
-rw-r--r--src/apps/mplayerc/WebServer.cpp10
-rw-r--r--src/apps/mplayerc/mpcresources/common.pl81
-rw-r--r--src/apps/mplayerc/mpcresources/mpcresources.vcproj40
-rw-r--r--src/apps/mplayerc/mpcresources/mpcresources.vcxproj120
-rw-r--r--src/apps/mplayerc/mpcresources/mplayerc.de.rcbin345794 -> 345896 bytes
-rw-r--r--src/apps/mplayerc/mpcresources/patch.bat2
-rw-r--r--src/apps/mplayerc/mpcresources/rcfile.pl202
-rw-r--r--src/apps/mplayerc/mpcresources/rcstrings.bat7
-rw-r--r--src/apps/mplayerc/mpcresources/rcstrings.pl129
-rw-r--r--src/filters/reader/UDPReader/UDPReader.cpp28
-rw-r--r--src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp4
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/config.h1
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/custom_code.txt1
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h17
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.h4
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c17
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpegvideo.c15
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/parser.c6
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c11
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.c29
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.h3
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1dec.c5
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/dsputil_mmx.c1
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/fft_mmx.asm42
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264_idct.asm109
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c213
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_MpegPs.cpp110
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_MpegTs.cpp305
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_MpegTs.h2
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_MpegTs_Duplicate.cpp4
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.cpp10
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.h6
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.cpp16
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.h2
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_Riff.cpp10
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_Riff.h1
-rw-r--r--src/thirdparty/MediaInfo/Multiple/File_Riff_Elements.cpp12
-rw-r--r--src/thirdparty/MediaInfo/Video/File_Mpegv.cpp54
-rw-r--r--src/thirdparty/lcms2/src/cmslut.c23
-rw-r--r--src/thirdparty/lcms2/src/cmstypes.c11
70 files changed, 1323 insertions, 894 deletions
diff --git a/src/Subtitles/STS.cpp b/src/Subtitles/STS.cpp
index fa05ea303..cef422995 100644
--- a/src/Subtitles/STS.cpp
+++ b/src/Subtitles/STS.cpp
@@ -1038,7 +1038,7 @@ static CStringW SMI2SSA(CStringW str, int CharSet)
if(g_colors.Lookup(CString(arg), val))
color = (DWORD)val;
else if((color = wcstol(arg, NULL, 16) ) == 0)
- color = 0x00ffffff; // default is white
+ color = 0x00ffffff; // default is white
arg.Format(L"%02x%02x%02x", color&0xff, (color>>8)&0xff, (color>>16)&0xff);
lstr.Insert(k + l + chars_inserted, CStringW(L"{\\c&H") + arg + L"&}");
@@ -1642,7 +1642,7 @@ static bool OpenSubStationAlpha(CTextFile* file, CSimpleTextSubtitle& ret, int C
if(version <= 4)
{
- GetStr(buff, '='); /* Marked = */
+ GetStr(buff, '='); /* Marked = */
GetInt(buff);
}
if(version >= 5)layer = GetInt(buff);
@@ -3553,7 +3553,7 @@ bool MOD_PNGIMAGE::processData(png_structp png_ptr)
// ARGB -> RGBA
// if (color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-// png_set_swap_alpha(png_ptr);
+// png_set_swap_alpha(png_ptr);
// grayscale -> RGB
if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
@@ -3591,10 +3591,18 @@ bool MOD_PNGIMAGE::initImage(CString m_fn)
FILE *fp = fopen(fn, "rb");
if (!fp) return false; // File could not be opened for reading
fread(header, 1, 8, fp);
- if (png_sig_cmp((png_bytep)header, 0, 8)) return false; // File is not recognized as a PNG file
+ if (png_sig_cmp((png_bytep)header, 0, 8)) // File is not recognized as a PNG file
+ {
+ fclose(fp);
+ return false;
+ }
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
- if (!png_ptr) return false; // png_create_read_struct failed
+ if (!png_ptr) // png_create_read_struct failed
+ {
+ fclose(fp);
+ return false;
+ }
png_init_io(png_ptr, fp);
return processData(png_ptr);
diff --git a/src/apps/SubResync/SubResync.cpp b/src/apps/SubResync/SubResync.cpp
index 000484c28..42c354938 100644
--- a/src/apps/SubResync/SubResync.cpp
+++ b/src/apps/SubResync/SubResync.cpp
@@ -63,7 +63,7 @@ BOOL CSubresyncApp::InitInstance()
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
- CSubresyncDlg dlg(cmdInfo.m_strFileName);
+ CSubresyncDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
diff --git a/src/apps/SubResync/SubResync.rc b/src/apps/SubResync/SubResync.rc
index 24f4f1c7f..5adeba7ba 100644
--- a/src/apps/SubResync/SubResync.rc
+++ b/src/apps/SubResync/SubResync.rc
@@ -13,54 +13,6 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// Hungarian resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_HUN)
-#ifdef _WIN32
-LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
-#pragma code_page(1250)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "LANGUAGE 9, 1\r\n"
- "#pragma code_page(1252)\r\n"
- "#include ""res\\SubResync.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#endif\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // Hungarian resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
diff --git a/src/apps/SubResync/SubResync.vcproj b/src/apps/SubResync/SubResync.vcproj
index 2e51a2c0f..be88738e2 100644
--- a/src/apps/SubResync/SubResync.vcproj
+++ b/src/apps/SubResync/SubResync.vcproj
@@ -55,7 +55,6 @@
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
- AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -128,7 +127,6 @@
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
- AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
diff --git a/src/apps/SubResync/SubResyncDlg.cpp b/src/apps/SubResync/SubResyncDlg.cpp
index 3206b1172..46c21f6dd 100644
--- a/src/apps/SubResync/SubResyncDlg.cpp
+++ b/src/apps/SubResync/SubResyncDlg.cpp
@@ -62,6 +62,10 @@ CSubresyncDlg::CSubresyncDlg(CWnd* pParent /*=NULL*/)
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
+CSubresyncDlg::~CSubresyncDlg()
+{
+}
+
void CSubresyncDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
diff --git a/src/apps/SubResync/SubResyncDlg.h b/src/apps/SubResync/SubResyncDlg.h
index 1b6f9edf0..1dea143a6 100644
--- a/src/apps/SubResync/SubResyncDlg.h
+++ b/src/apps/SubResync/SubResyncDlg.h
@@ -63,7 +63,7 @@ class CSubresyncDlg : public CDialog
{
// Construction
public:
- CSubresyncDlg(CString fn, CWnd* pParent = NULL); // standard constructor
+ CSubresyncDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CSubresyncDlg();
bool Open(CString fn, int CharSet = DEFAULT_CHARSET, bool fAppend = false, int timeoff = 0);
diff --git a/src/apps/VSConv/VSConv.rc b/src/apps/VSConv/VSConv.rc
index a1bc970df..94b9ef9a4 100644
--- a/src/apps/VSConv/VSConv.rc
+++ b/src/apps/VSConv/VSConv.rc
@@ -13,50 +13,14 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// Hungarian resources
+// English (U.S.) resources
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_HUN)
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
-LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
-#pragma code_page(1250)
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
#endif //_WIN32
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "LANGUAGE 9, 1\r\n"
- "#pragma code_page(1252)\r\n"
- "#include ""res\\VSConv.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#endif\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
/////////////////////////////////////////////////////////////////////////////
//
// Icon
@@ -69,18 +33,6 @@ IDR_MAINFRAME ICON "res\\VSConv_2010.ico"
#else
IDR_MAINFRAME ICON "res\\VSConv.ico"
#endif
-#endif // Hungarian resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/apps/VSConv/VSConv_2010.sln b/src/apps/VSConv/VSConv_2010.sln
index 49e00b897..a3eb0c1e2 100644
--- a/src/apps/VSConv/VSConv_2010.sln
+++ b/src/apps/VSConv/VSConv_2010.sln
@@ -1,8 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsconv", "vsconv.vcxproj", "{F655A8A5-A73E-4EE0-89B4-2758055B3768}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VSConv", "VSConv.vcxproj", "{F655A8A5-A73E-4EE0-89B4-2758055B3768}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subtitles", "..\..\subtitles\subtitles.vcxproj", "{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Subtitles", "..\..\Subtitles\Subtitles.vcxproj", "{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BaseClasses", "..\..\filters\BaseClasses\BaseClasses.vcxproj", "{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}"
EndProject
diff --git a/src/apps/mplayerc/Changelog.txt b/src/apps/mplayerc/Changelog.txt
index bb34f3dee..9db31df54 100644
--- a/src/apps/mplayerc/Changelog.txt
+++ b/src/apps/mplayerc/Changelog.txt
@@ -12,10 +12,11 @@ v1.5.xxxx.0 - unreleased
CHANGED: Updated FFmpeg
CHANGED: Updated MediaInfoLib to v0.7.36 Beta
CHANGED: Updated ZenLib to v0.4.16 Beta
- CHANGED: Updated Little CMS to v2.1(alpha1) - 09172010
+ CHANGED: Updated Little CMS to v2.1(alpha1) - 09282010
CHANGED: Updated libpng to v1.4.4
CHANGED: Cleaned up and optimized code for QT PCM, small corrections in MP4Splitter
FIXED : Ticket #52, [playlist] shuffle is broken
+ FIXED : Ticket #293, giving "remember last window size" a meaning
FIXED : Ticket #564, EVR Sync enabled when it shouldn't be
FIXED : Ticket #627, Don't create the "AppData\Roaming\Media Player Classic"
folder if the "Remember items" in playlist is disabled
@@ -23,14 +24,17 @@ v1.5.xxxx.0 - unreleased
FIXED : Ticket #647, Weird "keys" listed
FIXED : Ticket #651, Make EVR CP stats graph smaller
FIXED : Ticket #652, Escape key on certain form causes form to collapse
+ FIXED : Ticket #678, Remember last window size NOT working and mpc-hc.ini
FIXED : Ticket #698, VMR-9 (Renderless) + pixel shaders crashes
FIXED : Ticket #699, fix EAC3 mediatype and string
+ FIXED : Ticket #712, Audio renderer menu problem with Haali splitter after r2339
FIXED : Ticket #724, Frequency range and bandwidth value are currently
not taken into account when doing a scan
FIXED : Ticket #753, DVB-T, internal MPEG-2 filter & wrong aspect ratio
FIXED : Ticket #778, Playlist interface problem
FIXED : Ticket #782, VMR-7 & 9 filter names misspelled
FIXED : Ticket #791, Change the cursor behavior
+ FIXED : Ticket #796, MPC HC window doesn't stay snapped to desktop corners
FIXED : Ticket #809, Resize-arrows no longer appear with caption hidden
diff --git a/src/apps/mplayerc/FGFilter.cpp b/src/apps/mplayerc/FGFilter.cpp
index c21196da2..3c44dfa66 100644
--- a/src/apps/mplayerc/FGFilter.cpp
+++ b/src/apps/mplayerc/FGFilter.cpp
@@ -77,13 +77,13 @@ bool CFGFilter::CheckTypes(const CAtlArray<GUID>& types, bool fExactMatch)
if(fExactMatch)
{
if(majortype == types[i] && majortype != GUID_NULL
- && subtype == types[i+1] && subtype != GUID_NULL)
+ && subtype == types[i+1] && subtype != GUID_NULL)
return true;
}
else
{
if((majortype == GUID_NULL || types[i] == GUID_NULL || majortype == types[i])
- && (subtype == GUID_NULL || types[i+1] == GUID_NULL || subtype == types[i+1]))
+ && (subtype == GUID_NULL || types[i+1] == GUID_NULL || subtype == types[i+1]))
return true;
}
}
@@ -306,7 +306,7 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len)
BYTE* ptr = NULL;
if(SUCCEEDED(pFD.CoCreateInstance(CLSID_FilterMapper2))
- && SUCCEEDED(pFD->ParseFilterData(p, len, (BYTE**)&ptr)))
+ && SUCCEEDED(pFD->ParseFilterData(p, len, (BYTE**)&ptr)))
{
REGFILTER2* prf = (REGFILTER2*)*(WPARAM*)ptr; // this is f*cked up
@@ -412,7 +412,7 @@ void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len)
ChkLen(8)
if(*(DWORD*)p < (p-base+8) || *(DWORD*)p >= len
- || *(DWORD*)(p+4) < (p-base+8) || *(DWORD*)(p+4) >= len)
+ || *(DWORD*)(p+4) < (p-base+8) || *(DWORD*)(p+4) >= len)
{
p += 8;
continue;
@@ -468,17 +468,17 @@ HRESULT CFGFilterVideoRenderer::Create(IBaseFilter** ppBF, CInterfaceList<IUnkno
CComPtr<ISubPicAllocatorPresenter> pCAP;
if(m_clsid == CLSID_VMR7AllocatorPresenter
- || m_clsid == CLSID_VMR9AllocatorPresenter
- || m_clsid == CLSID_DXRAllocatorPresenter
- || m_clsid == CLSID_madVRAllocatorPresenter
- || m_clsid == CLSID_EVRAllocatorPresenter
- || m_clsid == CLSID_SyncAllocatorPresenter)
+ || m_clsid == CLSID_VMR9AllocatorPresenter
+ || m_clsid == CLSID_DXRAllocatorPresenter
+ || m_clsid == CLSID_madVRAllocatorPresenter
+ || m_clsid == CLSID_EVRAllocatorPresenter
+ || m_clsid == CLSID_SyncAllocatorPresenter)
{
bool bFullscreen = (AfxGetApp()->m_pMainWnd != NULL) && (((CMainFrame*)AfxGetApp()->m_pMainWnd)->IsD3DFullScreenMode());
if(SUCCEEDED(CreateAP7(m_clsid, m_hWnd, &pCAP))
- || SUCCEEDED(CreateAP9(m_clsid, m_hWnd, bFullscreen, &pCAP))
- || SUCCEEDED(CreateEVR(m_clsid, m_hWnd, bFullscreen, &pCAP))
- || SUCCEEDED(CreateSyncRenderer(m_clsid, m_hWnd, bFullscreen, &pCAP)))
+ || SUCCEEDED(CreateAP9(m_clsid, m_hWnd, bFullscreen, &pCAP))
+ || SUCCEEDED(CreateEVR(m_clsid, m_hWnd, bFullscreen, &pCAP))
+ || SUCCEEDED(CreateSyncRenderer(m_clsid, m_hWnd, bFullscreen, &pCAP)))
{
CComPtr<IUnknown> pRenderer;
if(SUCCEEDED(hr = pCAP->CreateRenderer(&pRenderer)))
@@ -550,7 +550,7 @@ void CFGFilterList::Insert(CFGFilter* pFGF, int group, bool exactmatch, bool aut
if(CFGFilterRegistry* f2r = dynamic_cast<CFGFilterRegistry*>(f2.pFGF))
{
if(f1r->GetMoniker() && f2r->GetMoniker() && S_OK == f1r->GetMoniker()->IsEqual(f2r->GetMoniker())
- || f1r->GetCLSID() != GUID_NULL && f1r->GetCLSID() == f2r->GetCLSID())
+ || f1r->GetCLSID() != GUID_NULL && f1r->GetCLSID() == f2r->GetCLSID())
{
TRACE(_T("FGM: Inserting %d %d %016I64x '%s' NOT!\n"),
group, exactmatch, pFGF->GetMerit(),
diff --git a/src/apps/mplayerc/FakeFilterMapper2.cpp b/src/apps/mplayerc/FakeFilterMapper2.cpp
index 7cc958483..2c9c43bba 100644
--- a/src/apps/mplayerc/FakeFilterMapper2.cpp
+++ b/src/apps/mplayerc/FakeFilterMapper2.cpp
@@ -272,8 +272,8 @@ HRESULT WINAPI Mine_CoCreateInstance(IN REFCLSID rclsid, IN LPUNKNOWN pUnkOuter,
*/
if(!pUnkOuter)
if(rclsid == CLSID_VideoMixingRenderer || rclsid == CLSID_VideoMixingRenderer9
- || rclsid == CLSID_VideoRenderer || rclsid == CLSID_VideoRendererDefault
- || rclsid == CLSID_OverlayMixer)// || rclsid == CLSID_OverlayMixer2 - where is this declared?)
+ || rclsid == CLSID_VideoRenderer || rclsid == CLSID_VideoRendererDefault
+ || rclsid == CLSID_OverlayMixer)// || rclsid == CLSID_OverlayMixer2 - where is this declared?)
{
CMacrovisionKicker* pMK = DNew CMacrovisionKicker(NAME("CMacrovisionKicker"), NULL);
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)pMK;
diff --git a/src/apps/mplayerc/FloatEdit.cpp b/src/apps/mplayerc/FloatEdit.cpp
index 3c3d29656..4f4ca6326 100644
--- a/src/apps/mplayerc/FloatEdit.cpp
+++ b/src/apps/mplayerc/FloatEdit.cpp
@@ -141,7 +141,7 @@ END_MESSAGE_MAP()
void CHexEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if(!(nChar >= 'A' && nChar <= 'F' || nChar >= 'a' && nChar <= 'f'
- || nChar >= '0' && nChar <= '9' || nChar == '\b'))
+ || nChar >= '0' && nChar <= '9' || nChar == '\b'))
return;
CString str;
diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp
index 7b0e93309..4aad24334 100644
--- a/src/apps/mplayerc/MainFrm.cpp
+++ b/src/apps/mplayerc/MainFrm.cpp
@@ -4505,8 +4505,6 @@ void CMainFrame::OnFileReopen()
OpenCurPlaylistItem();
}
-void RecurseAddDir(CString path, CAtlList<CString>* sl);
-
void CMainFrame::OnDropFiles(HDROP hDropInfo)
{
SetForegroundWindow();
@@ -9225,10 +9223,19 @@ static BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT l
void CMainFrame::SetDefaultWindowRect(int iMonitor)
{
AppSettings& s = AfxGetAppSettings();
+ int w, h, x, y;
+ if(s.HasFixedWindowSize())
{
- boolean m_center = true;
-
+ w = s.fixedWindowSize.cx;
+ h = s.fixedWindowSize.cy;
+ }
+ else if(s.fRememberWindowSize)
+ {
+ w = s.rcLastWindowPos.Width();
+ h = s.rcLastWindowPos.Height();
+ }
+ else {
CRect r1, r2;
GetClientRect(&r1);
m_wndView.GetClientRect(&r2);
@@ -9242,32 +9249,24 @@ void CMainFrame::SetDefaultWindowRect(int iMonitor)
DWORD style = GetStyle();
- MENUBARINFO mbi;
- memset(&mbi, 0, sizeof(mbi));
- mbi.cbSize = sizeof(mbi);
- ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi);
-
- int w = _DEFCLIENTW + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CXSIZEFRAME)*2 : 0)
- + r1.Width() - r2.Width();
- int h = _DEFCLIENTH + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CYSIZEFRAME)*2 : 0)
- + (mbi.rcBar.bottom - mbi.rcBar.top)
- + r1.Height() - r2.Height()
- + 1; // ???
-// + 2; // ???
- if(style&WS_CAPTION) h += GetSystemMetrics(SM_CYCAPTION);
+ w = _DEFCLIENTW + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CXSIZEFRAME)*2 : 0)
+ + r1.Width() - r2.Width();
+ h = _DEFCLIENTH + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CYSIZEFRAME)*2 : 0)
+ + r1.Height() - r2.Height();
- if(s.HasFixedWindowSize())
- {
- w = s.fixedWindowSize.cx;
- h = s.fixedWindowSize.cy;
- }
- else if(s.fRememberWindowSize)
- {
- w = s.rcLastWindowPos.Width();
- h = s.rcLastWindowPos.Height();
- m_center = false;
+ if(style&WS_CAPTION) {
+ h += GetSystemMetrics(SM_CYCAPTION); // if we have caption then we have menu too
+ h += GetSystemMetrics(SM_CYMENU);
}
+ }
+ if(s.fRememberWindowPos)
+ {
+ x = s.rcLastWindowPos.TopLeft().x;
+ y = s.rcLastWindowPos.TopLeft().y;
+ }
+ else
+ {
HMONITOR hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
if(iMonitor > 0)
@@ -9282,48 +9281,31 @@ void CMainFrame::SetDefaultWindowRect(int iMonitor)
mi.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(hMonitor, &mi);
- int x = (mi.rcWork.left+mi.rcWork.right-w)/2;
- int y = (mi.rcWork.top+mi.rcWork.bottom-h)/2;
-
- if(s.fRememberWindowPos)
- {
- CRect r = s.rcLastWindowPos;
-// x = r.CenterPoint().x - w/2;
-// y = r.CenterPoint().y - h/2;
- x = r.TopLeft().x;
- y = r.TopLeft().y;
- m_center = false;
- }
-
- UINT lastWindowType = s.lastWindowType;
-
- MoveWindow(x, y, w, h);
+ x = (mi.rcWork.left+mi.rcWork.right-w)/2; // Center main window
+ y = (mi.rcWork.top+mi.rcWork.bottom-h)/2; // no need to call CenterWindow()
+ }
- // Center main window ...
- if(m_center) CenterWindow();
+ UINT lastWindowType = s.lastWindowType;
+ MoveWindow(x, y, w, h);
- // Waffs : fullscreen command line
- if(!(s.nCLSwitches&CLSW_ADD) && (s.nCLSwitches&CLSW_FULLSCREEN) && !s.slFiles.IsEmpty())
- {
- ToggleFullscreen(true, true);
- SetCursor(NULL);
- AfxGetAppSettings().nCLSwitches &= ~CLSW_FULLSCREEN;
- m_fFirstFSAfterLaunchOnFS = true;
- }
+ // Waffs : fullscreen command line
+ if(!(s.nCLSwitches&CLSW_ADD) && (s.nCLSwitches&CLSW_FULLSCREEN) && !s.slFiles.IsEmpty())
+ {
+ ToggleFullscreen(true, true);
+ SetCursor(NULL);
+ AfxGetAppSettings().nCLSwitches &= ~CLSW_FULLSCREEN;
+ m_fFirstFSAfterLaunchOnFS = true;
+ }
- if(s.fRememberWindowSize && s.fRememberWindowPos)
- {
- WINDOWPLACEMENT wp;
- memset(&wp, 0, sizeof(wp));
- wp.length = sizeof(WINDOWPLACEMENT);
- if(lastWindowType == SIZE_MAXIMIZED)
- ShowWindow(SW_MAXIMIZE);
- else if(lastWindowType == SIZE_MINIMIZED)
- ShowWindow(SW_MINIMIZE);
+ if(s.fRememberWindowSize && s.fRememberWindowPos)
+ {
+ if(lastWindowType == SIZE_MAXIMIZED)
+ ShowWindow(SW_MAXIMIZE);
+ else if(lastWindowType == SIZE_MINIMIZED)
+ ShowWindow(SW_MINIMIZE);
- // Casimir666 : if fullscreen was on, put it on back
- if (!m_fFullScreen && s.fLastFullScreen) ToggleFullscreen(true, true);
- }
+ // Casimir666 : if fullscreen was on, put it on back
+ if (!m_fFullScreen && s.fLastFullScreen) ToggleFullscreen(true, true);
}
if(s.fHideCaptionMenu)
@@ -9344,53 +9326,51 @@ void CMainFrame::RestoreDefaultWindowRect()
// && (GetExStyle()&WS_EX_APPWINDOW)
&& !s.fRememberWindowSize)
{
- CRect r1, r2;
- GetClientRect(&r1);
- m_wndView.GetClientRect(&r2);
-
- CSize logosize = m_wndView.GetLogoSize();
- int _DEFCLIENTW = max(logosize.cx, DEFCLIENTW);
- int _DEFCLIENTH = max(logosize.cy, DEFCLIENTH);
-
- DWORD style = GetStyle();
-
- MENUBARINFO mbi;
- memset(&mbi, 0, sizeof(mbi));
- mbi.cbSize = sizeof(mbi);
- ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi);
-
- int w = _DEFCLIENTW + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CXSIZEFRAME)*2 : 0)
- + r1.Width() - r2.Width();
- int h = _DEFCLIENTH + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CYSIZEFRAME)*2 : 0)
- + (mbi.rcBar.bottom - mbi.rcBar.top)
- + r1.Height() - r2.Height()
- + 1; // ???
-// + 2; // ???
- if(style&WS_CAPTION) h += GetSystemMetrics(SM_CYCAPTION);
+ int x, y, w, h;
if(s.HasFixedWindowSize())
{
w = s.fixedWindowSize.cx;
h = s.fixedWindowSize.cy;
}
+ else
+ {
+ CRect r1, r2;
+ GetClientRect(&r1);
+ m_wndView.GetClientRect(&r2);
- CRect r;
- GetWindowRect(r);
+ CSize logosize = m_wndView.GetLogoSize();
+ int _DEFCLIENTW = max(logosize.cx, DEFCLIENTW);
+ int _DEFCLIENTH = max(logosize.cy, DEFCLIENTH);
- int x = r.CenterPoint().x - w/2;
- int y = r.CenterPoint().y - h/2;
+ DWORD style = GetStyle();
+ w = _DEFCLIENTW + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CXSIZEFRAME)*2 : 0)
+ + r1.Width() - r2.Width();
+ h = _DEFCLIENTH + ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CYSIZEFRAME)*2 : 0)
+ + r1.Height() - r2.Height();
+
+ if(style&WS_CAPTION)
+ {
+ h += GetSystemMetrics(SM_CYCAPTION);
+ h += GetSystemMetrics(SM_CYMENU);
+ }
+ }
if(s.fRememberWindowPos)
{
- CRect r = s.rcLastWindowPos;
+ x = s.rcLastWindowPos.TopLeft().x;
+ y = s.rcLastWindowPos.TopLeft().y;
+ }
+ else
+ {
+ CRect r;
+ GetWindowRect(r);
- x = r.TopLeft().x;
- y = r.TopLeft().y;
+ x = r.CenterPoint().x - w/2; // Center window here
+ y = r.CenterPoint().y - h/2; // no need to call CenterWindow()
}
MoveWindow(x, y, w, h);
-
- if(!s.fRememberWindowPos) CenterWindow();
}
}
@@ -9407,6 +9387,7 @@ void CMainFrame::SetPlaybackMode(int iNewStatus)
if (m_wndNavigationBar.IsWindowVisible() && GetPlaybackMode() != PM_CAPTURE)
ShowControlBar(&m_wndNavigationBar, !m_wndNavigationBar.IsWindowVisible(), TRUE);
}
+
CSize CMainFrame::GetVideoSize()
{
bool fKeepAspectRatio = AfxGetAppSettings().fKeepAspectRatio;
@@ -9493,7 +9474,7 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT
HMONITOR hm_cur = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
CMonitors monitors;
- bool m_PlayListBarVisible = false;
+ static bool m_PlayListBarVisible = false;
if(!m_fFullScreen)
{
@@ -9557,7 +9538,7 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT
ModifyStyleEx(dwRemoveEx, dwAddEx, SWP_NOZORDER);
::SetMenu(m_hWnd, hMenu);
- bool m_Change_Monitor = false;
+ static bool m_Change_Monitor = false;
// try disable shader when move from one monitor to other ...
if(m_fFullScreen)
{
@@ -9931,6 +9912,7 @@ void CMainFrame::ZoomVideoWindow(double scale)
OnGetMinMaxInfo(&mmi);
CRect r;
+ GetWindowRect(r);
int w = 0, h = 0;
if(!m_fAudioOnly)
@@ -9950,14 +9932,7 @@ void CMainFrame::ZoomVideoWindow(double scale)
+ r1.Width() - r2.Width()
+ lWidth;
- // This doesn't give correct menu pixel size
- //MENUBARINFO mbi;
- //memset(&mbi, 0, sizeof(mbi));
- //mbi.cbSize = sizeof(mbi);
- //::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi);
-
h = ((style&WS_THICKFRAME) ? GetSystemMetrics(SM_CYSIZEFRAME)*2 : 0)
- //+ (mbi.rcBar.bottom - mbi.rcBar.top)
+ r1.Height() - r2.Height()
+ lHeight;
@@ -9966,20 +9941,13 @@ void CMainFrame::ZoomVideoWindow(double scale)
h += GetSystemMetrics( SM_CYCAPTION );
// If we have a caption then we have a menu bar
h += GetSystemMetrics( SM_CYMENU );
- // Do not use magic values please !
- //w += 2; h += 2; // for the 1 pixel wide sunken frame
- //w += 2; h += 3; // for the inner black border
}
- GetWindowRect(r);
-
w = max(w, mmi.ptMinTrackSize.x);
h = max(h, mmi.ptMinTrackSize.y);
}
else
{
- GetWindowRect(r);
-
w = r.Width(); // mmi.ptMinTrackSize.x;
h = mmi.ptMinTrackSize.y;
}
@@ -9991,22 +9959,40 @@ void CMainFrame::ZoomVideoWindow(double scale)
w = min(w, (mi.rcWork.right - mi.rcWork.left));
h = min(h, (mi.rcWork.bottom - mi.rcWork.top));
- // center window
if(!s.fRememberWindowPos)
{
- CPoint cp = r.CenterPoint();
- r.left = cp.x - w/2;
- r.top = cp.y - h/2;
+ bool isSnapped = false;
+
+ if(s.fSnapToDesktopEdges) { // check if snapped to edges
+ isSnapped = (r.left == mi.rcWork.left) || (r.top == mi.rcWork.top)
+ || (r.right == mi.rcWork.right) || (r.bottom == mi.rcWork.bottom);
+ }
+
+ if(isSnapped) // prefer left, top snap to right, bottom snap
+ {
+ if(r.left == mi.rcWork.left) {}
+ else if(r.right == mi.rcWork.right)
+ {
+ r.left = r.right - w;
+ }
+
+ if(r.top == mi.rcWork.top) {}
+ else if(r.bottom == mi.rcWork.bottom)
+ {
+ r.top = r.bottom - h;
+ }
+ }
+ else // center window
+ {
+ CPoint cp = r.CenterPoint();
+ r.left = cp.x - w/2;
+ r.top = cp.y - h/2;
+ }
}
r.right = r.left + w;
r.bottom = r.top + h;
- /*
- MONITORINFO mi;
- mi.cbSize = sizeof(MONITORINFO);
- GetMonitorInfo(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi);
- */
if(r.right > mi.rcWork.right) r.OffsetRect(mi.rcWork.right-r.right, 0);
if(r.left < mi.rcWork.left) r.OffsetRect(mi.rcWork.left-r.left, 0);
if(r.bottom > mi.rcWork.bottom) r.OffsetRect(0, mi.rcWork.bottom-r.bottom);
diff --git a/src/apps/mplayerc/PPageAccelTbl.cpp b/src/apps/mplayerc/PPageAccelTbl.cpp
index b93a64c02..c4f865ac1 100644
--- a/src/apps/mplayerc/PPageAccelTbl.cpp
+++ b/src/apps/mplayerc/PPageAccelTbl.cpp
@@ -134,7 +134,7 @@ CPPageAccelTbl::~CPPageAccelTbl()
BOOL CPPageAccelTbl::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN
- && (pMsg->hwnd == m_WinLircEdit.m_hWnd || pMsg->hwnd == m_UIceEdit.m_hWnd))
+ && (pMsg->hwnd == m_WinLircEdit.m_hWnd || pMsg->hwnd == m_UIceEdit.m_hWnd))
{
OnApply();
return TRUE;
@@ -1584,8 +1584,8 @@ void CPPageAccelTbl::OnBeginlabeleditList(NMHDR* pNMHDR, LRESULT* pResult)
return;
if(pItem->iSubItem == COL_MOD || pItem->iSubItem == COL_KEY || pItem->iSubItem == COL_TYPE
- || pItem->iSubItem == COL_MOUSE || pItem->iSubItem == COL_APPCMD
- || pItem->iSubItem == COL_RMCMD || pItem->iSubItem == COL_RMREPCNT)
+ || pItem->iSubItem == COL_MOUSE || pItem->iSubItem == COL_APPCMD
+ || pItem->iSubItem == COL_RMCMD || pItem->iSubItem == COL_RMREPCNT)
{
*pResult = TRUE;
}
diff --git a/src/apps/mplayerc/PPageBase.cpp b/src/apps/mplayerc/PPageBase.cpp
index 0765f465a..12b0409f3 100644
--- a/src/apps/mplayerc/PPageBase.cpp
+++ b/src/apps/mplayerc/PPageBase.cpp
@@ -65,8 +65,8 @@ BOOL CPPageBase::PreTranslateMessage(MSG* pMsg)
MSG msg;
memcpy(&msg, pMsg, sizeof(MSG));
for(HWND hWndParent = ::GetParent(msg.hwnd);
- hWndParent && hWndParent != m_hWnd;
- hWndParent = ::GetParent(hWndParent))
+ hWndParent && hWndParent != m_hWnd;
+ hWndParent = ::GetParent(hWndParent))
{
msg.hwnd = hWndParent;
}
diff --git a/src/apps/mplayerc/PPageFileInfoDetails.cpp b/src/apps/mplayerc/PPageFileInfoDetails.cpp
index 5d43cac24..35e5f19fd 100644
--- a/src/apps/mplayerc/PPageFileInfoDetails.cpp
+++ b/src/apps/mplayerc/PPageFileInfoDetails.cpp
@@ -309,7 +309,7 @@ void CPPageFileInfoDetails::InitEncoding()
CMediaTypeEx mt;
PIN_DIRECTION dir;
if(FAILED(pPin->QueryDirection(&dir)) || dir != PINDIR_OUTPUT
- || FAILED(pPin->ConnectionMediaType(&mt)))
+ || FAILED(pPin->ConnectionMediaType(&mt)))
continue;
CString str = mt.ToString();
diff --git a/src/apps/mplayerc/PPageFileMediaInfo.cpp b/src/apps/mplayerc/PPageFileMediaInfo.cpp
index 085a047fe..89621ab55 100644
--- a/src/apps/mplayerc/PPageFileMediaInfo.cpp
+++ b/src/apps/mplayerc/PPageFileMediaInfo.cpp
@@ -70,7 +70,7 @@ static LRESULT CALLBACK ControlProc(HWND control, UINT message, WPARAM wParam, L
{
if(message == WM_KEYDOWN) {
if ((LOWORD(wParam)== 'A' || LOWORD(wParam) == 'a')
- &&(GetKeyState(VK_CONTROL) < 0)) {
+ &&(GetKeyState(VK_CONTROL) < 0)) {
CEdit *pEdit = (CEdit*)CWnd::FromHandle(control);
pEdit->SetSel(0, pEdit->GetWindowTextLength(), TRUE);
return 0;
diff --git a/src/apps/mplayerc/PPageFormats.cpp b/src/apps/mplayerc/PPageFormats.cpp
index 15ca29065..06b8094be 100644
--- a/src/apps/mplayerc/PPageFormats.cpp
+++ b/src/apps/mplayerc/PPageFormats.cpp
@@ -834,7 +834,7 @@ void CPPageFormats::OnLvnItemchangedList1(NMHDR *pNMHDR, LRESULT *pResult)
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
if(pNMLV->iItem >= 0 && pNMLV->iSubItem == COL_CATEGORY
- && (pNMLV->uChanged&LVIF_STATE) && (pNMLV->uNewState&LVIS_SELECTED))
+ && (pNMLV->uChanged&LVIF_STATE) && (pNMLV->uNewState&LVIS_SELECTED))
{
m_exts = AfxGetAppSettings().Formats[(int)m_list.GetItemData(pNMLV->iItem)].GetExtsWithPeriod();
UpdateData(FALSE);
diff --git a/src/apps/mplayerc/PPageFullscreen.cpp b/src/apps/mplayerc/PPageFullscreen.cpp
index 6daba5f95..dcd759229 100644
--- a/src/apps/mplayerc/PPageFullscreen.cpp
+++ b/src/apps/mplayerc/PPageFullscreen.cpp
@@ -301,17 +301,17 @@ void CPPageFullscreen::ModesUpdate()
m_dispmode29d97combo.AddString(str);
if(iSel_24 < 0 && dmtoset24.fValid && dm.size == dmtoset24.size
- && dm.bpp == dmtoset24.bpp && dm.freq == dmtoset24.freq) iSel_24 = j;
+ && dm.bpp == dmtoset24.bpp && dm.freq == dmtoset24.freq) iSel_24 = j;
if(iSel_25 < 0 && dmtoset25.fValid && dm.size == dmtoset25.size
- && dm.bpp == dmtoset25.bpp && dm.freq == dmtoset25.freq) iSel_25 = j;
+ && dm.bpp == dmtoset25.bpp && dm.freq == dmtoset25.freq) iSel_25 = j;
if(iSel_30 < 0 && dmtoset30.fValid && dm.size == dmtoset30.size
- && dm.bpp == dmtoset30.bpp && dm.freq == dmtoset30.freq) iSel_30 = j;
+ && dm.bpp == dmtoset30.bpp && dm.freq == dmtoset30.freq) iSel_30 = j;
if(iSel_Other < 0 && dmtosetOther.fValid && dm.size == dmtosetOther.size
- && dm.bpp == dmtosetOther.bpp && dm.freq == dmtosetOther.freq) iSel_Other = j;
+ && dm.bpp == dmtosetOther.bpp && dm.freq == dmtosetOther.freq) iSel_Other = j;
if(iSel_23 < 0 && dmtoset23.fValid && dm.size == dmtoset23.size
- && dm.bpp == dmtoset23.bpp && dm.freq == dmtoset23.freq) iSel_23 = j;
+ && dm.bpp == dmtoset23.bpp && dm.freq == dmtoset23.freq) iSel_23 = j;
if(iSel_29 < 0 && dmtoset29.fValid && dm.size == dmtoset29.size
- && dm.bpp == dmtoset29.bpp && dm.freq == dmtoset29.freq) iSel_29 = j;
+ && dm.bpp == dmtoset29.bpp && dm.freq == dmtoset29.freq) iSel_29 = j;
j++;
}
m_dispmode24combo.SetCurSel(iSel_24);
diff --git a/src/apps/mplayerc/PPagePlayback.cpp b/src/apps/mplayerc/PPagePlayback.cpp
index cdacd0a2b..ca1f25c9d 100644
--- a/src/apps/mplayerc/PPagePlayback.cpp
+++ b/src/apps/mplayerc/PPagePlayback.cpp
@@ -184,3 +184,21 @@ void CPPagePlayback::OnUpdateAutoZoomCombo(CCmdUI* pCmdUI)
{
pCmdUI->Enable(!!IsDlgButtonChecked(IDC_CHECK5));
}
+
+BOOL CPPagePlayback::OnSetActive()
+{
+ AppSettings& s = AfxGetAppSettings();
+ m_iRememberZoomLevel = !!s.fRememberZoomLevel;
+ UpdateData(FALSE);
+
+ return __super::OnSetActive();
+}
+
+BOOL CPPagePlayback::OnKillActive()
+{
+ AppSettings& s = AfxGetAppSettings();
+ if(s.fRememberZoomLevel)
+ s.fRememberWindowSize = false;
+
+ return __super::OnKillActive();
+} \ No newline at end of file
diff --git a/src/apps/mplayerc/PPagePlayback.h b/src/apps/mplayerc/PPagePlayback.h
index 4bb147491..4232d3140 100644
--- a/src/apps/mplayerc/PPagePlayback.h
+++ b/src/apps/mplayerc/PPagePlayback.h
@@ -62,6 +62,8 @@ public:
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();
+ virtual BOOL OnSetActive();
+ virtual BOOL OnKillActive();
virtual BOOL OnApply();
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
diff --git a/src/apps/mplayerc/PPagePlayer.cpp b/src/apps/mplayerc/PPagePlayer.cpp
index 22baa4afc..a64e6b202 100644
--- a/src/apps/mplayerc/PPagePlayer.cpp
+++ b/src/apps/mplayerc/PPagePlayer.cpp
@@ -180,3 +180,21 @@ void CPPagePlayer::OnUpdatePos(CCmdUI* pCmdUI)
pCmdUI->Enable( !!m_fKeepHistory );
}
+
+BOOL CPPagePlayer::OnSetActive()
+{
+ AppSettings& s = AfxGetAppSettings();
+ m_fRememberWindowSize = !!s.fRememberWindowSize;
+ UpdateData(FALSE);
+
+ return __super::OnSetActive();
+}
+
+BOOL CPPagePlayer::OnKillActive()
+{
+ AppSettings& s = AfxGetAppSettings();
+ if(s.fRememberWindowSize)
+ s.fRememberZoomLevel = false;
+
+ return __super::OnKillActive();
+} \ No newline at end of file
diff --git a/src/apps/mplayerc/PPagePlayer.h b/src/apps/mplayerc/PPagePlayer.h
index dd1f77ee0..475060b8e 100644
--- a/src/apps/mplayerc/PPagePlayer.h
+++ b/src/apps/mplayerc/PPagePlayer.h
@@ -59,6 +59,8 @@ public:
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();
+ virtual BOOL OnSetActive();
+ virtual BOOL OnKillActive();
virtual BOOL OnApply();
DECLARE_MESSAGE_MAP()
diff --git a/src/apps/mplayerc/PlayerCaptureDialog.cpp b/src/apps/mplayerc/PlayerCaptureDialog.cpp
index e0362bbf3..b9a35af7e 100644
--- a/src/apps/mplayerc/PlayerCaptureDialog.cpp
+++ b/src/apps/mplayerc/PlayerCaptureDialog.cpp
@@ -195,7 +195,7 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo
int iCount = 0, iSize;
if(SUCCEEDED(pAMSC->GetNumberOfCapabilities(&iCount, &iSize))
- && iSize == sizeof(T) && iCount > 0)
+ && iSize == sizeof(T) && iCount > 0)
{
for(int i = 0; i < iCount; i++)
{
@@ -216,7 +216,7 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo
CFormatElem<T>* pfe = tfa[i]->GetAt(0);
if(pfe->mt.formattype != FORMAT_VideoInfo
- && pfe->mt.formattype != FORMAT_VideoInfo2)
+ && pfe->mt.formattype != FORMAT_VideoInfo2)
continue;
static SIZE presets[] =
@@ -242,13 +242,13 @@ static void SetupMediaTypes(IAMStreamConfig* pAMSC, CFormatArray<T>& tfa, CCombo
for(int j = 0; j < countof(presets); j++)
{
if(presets[j].cx == bihCur.biWidth
- && presets[j].cy == abs(bihCur.biHeight)
- || presets[j].cx < pcaps->MinOutputSize.cx
- || presets[j].cx > pcaps->MaxOutputSize.cx
- || presets[j].cy < pcaps->MinOutputSize.cy
- || presets[j].cy > pcaps->MaxOutputSize.cy
- || presets[j].cx % pcaps->OutputGranularityX
- || presets[j].cy % pcaps->OutputGranularityY)
+ && presets[j].cy == abs(bihCur.biHeight)
+ || presets[j].cx < pcaps->MinOutputSize.cx
+ || presets[j].cx > pcaps->MaxOutputSize.cx
+ || presets[j].cy < pcaps->MinOutputSize.cy
+ || presets[j].cy > pcaps->MaxOutputSize.cy
+ || presets[j].cx % pcaps->OutputGranularityX
+ || presets[j].cy % pcaps->OutputGranularityY)
continue;
CMediaType mt = pfe->mt;
diff --git a/src/apps/mplayerc/PlayerListCtrl.cpp b/src/apps/mplayerc/PlayerListCtrl.cpp
index 4f9ad23fb..64ee33969 100644
--- a/src/apps/mplayerc/PlayerListCtrl.cpp
+++ b/src/apps/mplayerc/PlayerListCtrl.cpp
@@ -57,9 +57,9 @@ BOOL CInPlaceEdit::PreTranslateMessage(MSG* pMsg)
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_RETURN
- || pMsg->wParam == VK_DELETE
- || pMsg->wParam == VK_ESCAPE
- || GetKeyState(VK_CONTROL))
+ || pMsg->wParam == VK_DELETE
+ || pMsg->wParam == VK_ESCAPE
+ || GetKeyState(VK_CONTROL))
{
::TranslateMessage(pMsg);
::DispatchMessage(pMsg);
@@ -177,7 +177,7 @@ BOOL CInPlaceComboBox::PreTranslateMessage(MSG* pMsg)
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_RETURN
- || pMsg->wParam == VK_ESCAPE)
+ || pMsg->wParam == VK_ESCAPE)
{
::TranslateMessage(pMsg);
::DispatchMessage(pMsg);
@@ -285,7 +285,7 @@ BOOL CInPlaceListBox::PreTranslateMessage(MSG* pMsg)
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_RETURN
- || pMsg->wParam == VK_ESCAPE)
+ || pMsg->wParam == VK_ESCAPE)
{
::TranslateMessage(pMsg);
::DispatchMessage(pMsg);
@@ -858,14 +858,14 @@ BOOL CPlayerListCtrl::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult)
UINT nID = pNMHDR->idFrom;
if(pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND)
- || pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
+ || pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}
- if(nID == 0) // Notification in NT from automatically
- return FALSE; // created tooltip
+ if(nID == 0) // Notification in NT from automatically
+ return FALSE; // created tooltip
if(pNMHDR->code == TTN_NEEDTEXTA) pTTTA->lParam = (LPARAM)m_hWnd;
else if(pNMHDR->code == TTN_NEEDTEXTW) pTTTW->lParam = (LPARAM)m_hWnd;
diff --git a/src/apps/mplayerc/PlayerNavigationDialog.cpp b/src/apps/mplayerc/PlayerNavigationDialog.cpp
index a1c6f03a5..282bd0da2 100644
--- a/src/apps/mplayerc/PlayerNavigationDialog.cpp
+++ b/src/apps/mplayerc/PlayerNavigationDialog.cpp
@@ -164,7 +164,7 @@ void CPlayerNavigationDialog::UpdateElementList()
{
CDVBChannel& Channel = s.DVBChannels.GetNext(pos);
if ((m_bTVStations && (Channel.GetVideoPID() != 0)) ||
- (!m_bTVStations && (Channel.GetAudioCount() > 0)) && (Channel.GetVideoPID() == 0))
+ (!m_bTVStations && (Channel.GetAudioCount() > 0)) && (Channel.GetVideoPID() == 0))
{
nItem = m_ChannelList.AddString (Channel.GetName());
if (nItem < MAX_CHANNELS_ALLOWED)
diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp
index 9364bbafd..19dae4177 100644
--- a/src/apps/mplayerc/PlayerPlaylistBar.cpp
+++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp
@@ -214,9 +214,9 @@ void CPlayerPlaylistBar::ResolveLinkFiles( CAtlList<CString> &fns )
CString& fn = fns.GetNext(pos);
TCHAR buff[_MAX_PATH];
if(CPath(fn).GetExtension().MakeLower() != _T(".lnk")
- || FAILED(pPF->Load(CStringW(fn), STGM_READ))
- || FAILED(pSL->Resolve(NULL, SLR_ANY_MATCH|SLR_NO_UI))
- || FAILED(pSL->GetPath(buff, countof(buff), NULL, 0)))
+ || FAILED(pPF->Load(CStringW(fn), STGM_READ))
+ || FAILED(pSL->Resolve(NULL, SLR_ANY_MATCH|SLR_NO_UI))
+ || FAILED(pSL->GetPath(buff, countof(buff), NULL, 0)))
continue;
fn = buff;
@@ -672,7 +672,7 @@ OpenMediaData* CPlayerPlaylistBar::GetCurOMD(REFERENCE_TIME rtStart)
CString fn = CString(pli->m_fns.GetHead()).MakeLower();
if(fn.Find(_T("video_ts.ifo")) >= 0
- || fn.Find(_T(".ratdvd")) >= 0)
+ || fn.Find(_T(".ratdvd")) >= 0)
{
if(OpenDVDData* p = DNew OpenDVDData())
{
@@ -1175,7 +1175,7 @@ BOOL CPlayerPlaylistBar::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResul
TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
if((pNMHDR->code == TTN_NEEDTEXTA && (HWND)pTTTA->lParam != m_list.m_hWnd)
- || (pNMHDR->code == TTN_NEEDTEXTW && (HWND)pTTTW->lParam != m_list.m_hWnd))
+ || (pNMHDR->code == TTN_NEEDTEXTW && (HWND)pTTTW->lParam != m_list.m_hWnd))
return FALSE;
int row = ((pNMHDR->idFrom-1) >> 10) & 0x3fffff;
diff --git a/src/apps/mplayerc/PlayerSubresyncBar.cpp b/src/apps/mplayerc/PlayerSubresyncBar.cpp
index e46470af7..1bcb250fd 100644
--- a/src/apps/mplayerc/PlayerSubresyncBar.cpp
+++ b/src/apps/mplayerc/PlayerSubresyncBar.cpp
@@ -591,10 +591,10 @@ static bool ParseTime(CString str, int& ret, bool fWarn = true)
h = abs(h);
if(n == 7
- && 0 <= h && h < 24
- && 0 <= m && m < 60
- && 0 <= s && s < 60
- && 0 <= ms && ms < 1000)
+ && 0 <= h && h < 24
+ && 0 <= m && m < 60
+ && 0 <= s && s < 60
+ && 0 <= ms && ms < 1000)
{
ret = sign*(h*60*60*1000+m*60*1000+s*1000+ms);
return(true);
@@ -614,9 +614,9 @@ void CPlayerSubresyncBar::OnBeginlabeleditList(NMHDR* pNMHDR, LRESULT* pResult)
if(pItem->iItem >= 0)
{
if((pItem->iSubItem == COL_START || pItem->iSubItem == COL_END || pItem->iSubItem == COL_TEXT
- || pItem->iSubItem == COL_STYLE || pItem->iSubItem == COL_LAYER
- || pItem->iSubItem == COL_ACTOR || pItem->iSubItem == COL_EFFECT)
- && m_mode == TEXTSUB)
+ || pItem->iSubItem == COL_STYLE || pItem->iSubItem == COL_LAYER
+ || pItem->iSubItem == COL_ACTOR || pItem->iSubItem == COL_EFFECT)
+ && m_mode == TEXTSUB)
{
*pResult = TRUE;
}
@@ -638,9 +638,9 @@ void CPlayerSubresyncBar::OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult)
if(pItem->iItem >= 0)
{
if((pItem->iSubItem == COL_START || pItem->iSubItem == COL_END || pItem->iSubItem == COL_TEXT
- || pItem->iSubItem == COL_STYLE || pItem->iSubItem == COL_LAYER
- || pItem->iSubItem == COL_ACTOR || pItem->iSubItem == COL_EFFECT)
- && m_mode == TEXTSUB)
+ || pItem->iSubItem == COL_STYLE || pItem->iSubItem == COL_LAYER
+ || pItem->iSubItem == COL_ACTOR || pItem->iSubItem == COL_EFFECT)
+ && m_mode == TEXTSUB)
{
m_list.ShowInPlaceEdit(pItem->iItem, pItem->iSubItem);
*pResult = TRUE;
@@ -1207,8 +1207,8 @@ void CPlayerSubresyncBar::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
COLORREF clrTextBk;
if((pLVCD->iSubItem == COL_START || pLVCD->iSubItem == COL_END || pLVCD->iSubItem == COL_TEXT || pLVCD->iSubItem == COL_STYLE
- || pLVCD->iSubItem == COL_LAYER || pLVCD->iSubItem == COL_ACTOR || pLVCD->iSubItem == COL_EFFECT)
- && m_mode == TEXTSUB)
+ || pLVCD->iSubItem == COL_LAYER || pLVCD->iSubItem == COL_ACTOR || pLVCD->iSubItem == COL_EFFECT)
+ && m_mode == TEXTSUB)
{
clrText = 0;
}
diff --git a/src/apps/mplayerc/Playlist.cpp b/src/apps/mplayerc/Playlist.cpp
index 3d49a2863..f659db5e7 100644
--- a/src/apps/mplayerc/Playlist.cpp
+++ b/src/apps/mplayerc/Playlist.cpp
@@ -171,7 +171,7 @@ void CPlaylistItem::AutoLoadFiles()
CString fullpath = path + fd.cFileName;
CString ext2 = fullpath.Mid(fullpath.ReverseFind('.')+1).MakeLower();
if(!FindFileInList(m_fns, fullpath) && ext != ext2
- && mf.FindExt(ext2, true) && mf.IsUsingEngine(fullpath, DirectShow))
+ && mf.FindExt(ext2, true) && mf.IsUsingEngine(fullpath, DirectShow))
{
m_fns.AddTail(fullpath);
}
diff --git a/src/apps/mplayerc/ShaderEditorDlg.cpp b/src/apps/mplayerc/ShaderEditorDlg.cpp
index 60d1b0a57..14f088b36 100644
--- a/src/apps/mplayerc/ShaderEditorDlg.cpp
+++ b/src/apps/mplayerc/ShaderEditorDlg.cpp
@@ -74,10 +74,10 @@ CShaderEdit::~CShaderEdit()
BOOL CShaderEdit::PreTranslateMessage(MSG* pMsg)
{
if(m_acdlg.IsWindowVisible()
- && pMsg->message == WM_KEYDOWN
- && (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN
- || pMsg->wParam == VK_PRIOR || pMsg->wParam == VK_NEXT
- || pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE))
+ && pMsg->message == WM_KEYDOWN
+ && (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN
+ || pMsg->wParam == VK_PRIOR || pMsg->wParam == VK_NEXT
+ || pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE))
{
int i = m_acdlg.m_list.GetCurSel();
@@ -301,7 +301,7 @@ END_MESSAGE_MAP()
BOOL CShaderEditorDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN
- && pMsg->hwnd == m_labels.m_edit.GetSafeHwnd())
+ && pMsg->hwnd == m_labels.m_edit.GetSafeHwnd())
{
OnCbnSelchangeCombo1();
diff --git a/src/apps/mplayerc/WebServer.cpp b/src/apps/mplayerc/WebServer.cpp
index 98fc05478..90d24ebdf 100644
--- a/src/apps/mplayerc/WebServer.cpp
+++ b/src/apps/mplayerc/WebServer.cpp
@@ -102,7 +102,7 @@ CWebServer::CWebServer(CMainFrame* pMainFrame, int nPort)
TCHAR ext[64];
ULONG len = countof(ext);
if(ERROR_SUCCESS == mime.Open(HKEY_CLASSES_ROOT, str + _T("\\") + buff, KEY_READ)
- && ERROR_SUCCESS == mime.QueryStringValue(_T("Extension"), ext, &len))
+ && ERROR_SUCCESS == mime.QueryStringValue(_T("Extension"), ext, &len))
m_mimes[CStringA(ext).MakeLower()] = CStringA(buff).MakeLower();
}
}
@@ -353,7 +353,7 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b
CString redir;
if(pClient->m_get.Lookup(_T("redir"), redir)
- || pClient->m_post.Lookup(_T("redir"), redir))
+ || pClient->m_post.Lookup(_T("redir"), redir))
{
if(redir.IsEmpty()) redir = '/';
@@ -620,9 +620,9 @@ bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& bod
if(hChildStdinRd && hChildStdoutWr)
if(CreateProcess(
- NULL, cmdln, NULL, NULL, TRUE, 0,
- envstr.GetLength() ? (LPVOID)(LPCSTR)envstr : NULL,
- dir, &siStartInfo, &piProcInfo))
+ NULL, cmdln, NULL, NULL, TRUE, 0,
+ envstr.GetLength() ? (LPVOID)(LPCSTR)envstr : NULL,
+ dir, &siStartInfo, &piProcInfo))
{
DWORD ThreadId;
CreateThread(NULL, 0, KillCGI, (LPVOID)piProcInfo.hProcess, 0, &ThreadId);
diff --git a/src/apps/mplayerc/mpcresources/common.pl b/src/apps/mplayerc/mpcresources/common.pl
index 0df199035..d129cbaa8 100644
--- a/src/apps/mplayerc/mpcresources/common.pl
+++ b/src/apps/mplayerc/mpcresources/common.pl
@@ -30,7 +30,7 @@ use Data::Dumper;
use vars qw(@InTags @TextTags $AdjustedDir);
-@InTags = qw(DIALOGEX MENU STRINGTABLE VERSIONINFO DLGINIT DESIGNINFO TOOLBAR);
+@InTags = qw(DIALOGEX MENU STRINGTABLE VERSIONINFO DIALOG DLGINIT TOOLBAR);
@TextTags = qw(BITMAP AVI ICON);
$AdjustedDir = q(..\\\\);
@@ -39,7 +39,7 @@ $AdjustedDir = q(..\\\\);
###################################################################################################
sub analyseData {
my ($input, $outline) = (shift, shift);
- my ($dialogs, $menus, $strings, $versionInfo) = @_;
+ my ($dialogs, $menus, $strings, $versionInfo, $designInfos) = @_;
my @inputs=();
push(@inputs, @{$input});
@@ -95,6 +95,11 @@ sub analyseData {
push(@{$outline},["VERSIONINFO",[@blocks]]);
push(@$versionInfo, @blocks);
}
+ elsif($tagidx ==4)
+ {
+ my $dlgname = readDesignInfo($designInfos, \@blocks);
+ push(@{$outline},["DESIGNINFO",[$dlgname, ""]]);
+ }
elsif($tagidx < @InTags){
push(@{$outline},["BLOCK",[@blocks]]);
}
@@ -121,6 +126,7 @@ sub readDialog {
my ($dialogs, $input) = @_;
my $dlgname;
+ my $fontname;
my $linenum = 0;
my @data=();
@@ -130,6 +136,11 @@ sub readDialog {
$dlgname = $1;
next;
}
+ if(/\bFONT\b.*(".*")/) {
+ $fontname = $1;
+ $dialogs->{$dlgname}->{"__FONT__"} = [$linenum, $fontname];
+ next;
+ }
next if /^STYLE\b/;
next if /^BEGIN\b/;
next if /^END\b/;
@@ -208,6 +219,25 @@ sub readStringTable {
}
#--------------------------------------------------------------------------------------------------
+sub readDesignInfo {
+ my ($designInfos, $input) = @_;
+
+ my $dlgname;
+ my @data=();
+
+ foreach(@$input){
+ if(/(ID\S+),\s*DIALOG\b/) {
+ $dlgname = $1;
+ last;
+ }
+ }
+ $designInfos->{$dlgname}->{"__TEXT__"}=[@$input];
+ $designInfos->{$dlgname}->{"__LINES__"} = $#$input + 1;
+
+ $dlgname;
+}
+
+#--------------------------------------------------------------------------------------------------
sub skipNonTranslatedStr {
my $line = shift;
@@ -347,4 +377,51 @@ sub lcs {
}
}
+#--------------------------------------------------------------------------------------------------
+sub writePatchFile {
+ my ($output, $data, $withBOM) = @_;
+
+ my @localData = ();
+ foreach (@$data) {
+ if($_->[0] eq "DIALOG") {
+ my $lines = $_->[1]{"__LINES__"};
+ while (my($key, $value)=each(%{$_->[1]})) {
+ if($key eq "__LINES__") {
+ next;
+ }
+ else {
+ push(@localData, "BEGIN DIALOGEX ".$key." LINES $lines");
+ foreach my $pair(@{$value}){
+ push(@localData, "$pair->[0]\t\t$pair->[1]");
+ }
+ }
+ }
+ push(@localData, "END");
+ push(@localData, "");
+ }
+ elsif($_->[0] eq "STRINGTABLE") {
+ my($key, $value)=each(%{$_->[1]});
+ push(@localData, "STRING $key\t\t$value");
+ }
+ elsif($_->[0] eq "MENU") {
+ my $lines = $_->[1]{"__LINES__"};
+ while (my($key, $value)=each(%{$_->[1]})) {
+ if($key eq "__LINES__") {
+ next;
+ }
+ else {
+ push(@localData, "BEGIN MENU ".$key. " LINES $lines");
+ foreach my $pair(@{$value}){
+ push(@localData, "$pair->[0]\t\t$pair->[1]");
+ }
+ }
+ }
+ push(@localData, "END");
+ push(@localData, "");
+ }
+ }
+
+ writeFile($output, \@localData, $withBOM);
+}
+
###################################################################################################
diff --git a/src/apps/mplayerc/mpcresources/mpcresources.vcproj b/src/apps/mplayerc/mpcresources/mpcresources.vcproj
index 90c013a20..3e60ae07f 100644
--- a/src/apps/mplayerc/mpcresources/mpcresources.vcproj
+++ b/src/apps/mplayerc/mpcresources/mpcresources.vcproj
@@ -55,6 +55,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -130,6 +131,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -204,6 +206,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -279,6 +282,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -353,6 +357,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -428,6 +433,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -502,6 +508,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -577,6 +584,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -651,6 +659,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -726,6 +735,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -800,6 +810,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -875,6 +886,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -949,6 +961,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1024,6 +1037,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1098,6 +1112,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1173,6 +1188,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1247,6 +1263,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1322,6 +1339,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1396,6 +1414,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1471,6 +1490,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1545,6 +1565,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1620,6 +1641,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1694,6 +1716,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1769,6 +1792,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1843,6 +1867,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1918,6 +1943,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -1992,6 +2018,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2067,6 +2094,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2141,6 +2169,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2216,6 +2245,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2290,6 +2320,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2365,6 +2396,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2439,6 +2471,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2514,6 +2547,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2588,6 +2622,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2663,6 +2698,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2737,6 +2773,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2812,6 +2849,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2886,6 +2924,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -2961,6 +3000,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;NO_VERSION_REV_NEEDED"
/>
<Tool
Name="VCPreLinkEventTool"
diff --git a/src/apps/mplayerc/mpcresources/mpcresources.vcxproj b/src/apps/mplayerc/mpcresources/mpcresources.vcxproj
index 8fe197480..08cb1e9b7 100644
--- a/src/apps/mplayerc/mpcresources/mpcresources.vcxproj
+++ b/src/apps/mplayerc/mpcresources/mpcresources.vcxproj
@@ -635,6 +635,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release French|x64'">
<Midl>
@@ -659,6 +662,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release German|Win32'">
<ClCompile>
@@ -680,6 +686,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release German|x64'">
<Midl>
@@ -704,6 +713,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Russian|Win32'">
<ClCompile>
@@ -725,6 +737,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Russian|x64'">
<Midl>
@@ -749,6 +764,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Turkish|Win32'">
<ClCompile>
@@ -770,6 +788,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Turkish|x64'">
<Midl>
@@ -794,6 +815,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Czech|Win32'">
<ClCompile>
@@ -815,6 +839,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Czech|x64'">
<Midl>
@@ -839,6 +866,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Spanish|Win32'">
<ClCompile>
@@ -860,6 +890,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Spanish|x64'">
<Midl>
@@ -884,6 +917,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Hungarian|Win32'">
<ClCompile>
@@ -905,6 +941,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Hungarian|x64'">
<Midl>
@@ -929,6 +968,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Korean|Win32'">
<ClCompile>
@@ -950,6 +992,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Korean|x64'">
<Midl>
@@ -974,6 +1019,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Polish|Win32'">
<ClCompile>
@@ -995,6 +1043,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Polish|x64'">
<Midl>
@@ -1019,6 +1070,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Ukrainian|Win32'">
<ClCompile>
@@ -1040,6 +1094,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Ukrainian|x64'">
<Midl>
@@ -1064,6 +1121,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Italian|Win32'">
<ClCompile>
@@ -1085,6 +1145,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Italian|x64'">
<Midl>
@@ -1109,6 +1172,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Slovak|Win32'">
<ClCompile>
@@ -1130,6 +1196,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Slovak|x64'">
<Midl>
@@ -1154,6 +1223,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Chinese simplified|Win32'">
<ClCompile>
@@ -1175,6 +1247,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Chinese simplified|x64'">
<Midl>
@@ -1199,6 +1274,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Chinese traditional|Win32'">
<ClCompile>
@@ -1220,6 +1298,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Chinese traditional|x64'">
<Midl>
@@ -1244,6 +1325,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Belarusian|Win32'">
<ClCompile>
@@ -1265,6 +1349,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Belarusian|x64'">
<Midl>
@@ -1289,6 +1376,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Swedish|Win32'">
<ClCompile>
@@ -1310,6 +1400,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Swedish|x64'">
<Midl>
@@ -1334,6 +1427,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Portuguese|Win32'">
<ClCompile>
@@ -1355,6 +1451,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Portuguese|x64'">
<Midl>
@@ -1379,6 +1478,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Dutch|Win32'">
<ClCompile>
@@ -1400,6 +1502,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Dutch|x64'">
<Midl>
@@ -1424,6 +1529,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Catalan|Win32'">
<ClCompile>
@@ -1445,6 +1553,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Catalan|x64'">
<Midl>
@@ -1469,6 +1580,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Japanese|Win32'">
<ClCompile>
@@ -1490,6 +1604,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Japanese|x64'">
<Midl>
@@ -1514,6 +1631,9 @@
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="mplayerc.br.rc">
diff --git a/src/apps/mplayerc/mpcresources/mplayerc.de.rc b/src/apps/mplayerc/mpcresources/mplayerc.de.rc
index ef4029d0f..b032615c6 100644
--- a/src/apps/mplayerc/mpcresources/mplayerc.de.rc
+++ b/src/apps/mplayerc/mpcresources/mplayerc.de.rc
Binary files differ
diff --git a/src/apps/mplayerc/mpcresources/patch.bat b/src/apps/mplayerc/mpcresources/patch.bat
index 5ad32e09d..1de67f0bc 100644
--- a/src/apps/mplayerc/mpcresources/patch.bat
+++ b/src/apps/mplayerc/mpcresources/patch.bat
@@ -4,5 +4,5 @@ rem A simple script demos how to apply translated text to locale rc file.
rem This is only an example, to use it you will have to change filenames.
echo Generating new rc files and string files...
-perl patch.pl -i newrc\mplayerc.fr.rc.txt newrc\mplayerc.fr.rc
+perl patch.pl -i text\mplayerc.fr.rc.txt mplayerc.fr.rc
pause \ No newline at end of file
diff --git a/src/apps/mplayerc/mpcresources/rcfile.pl b/src/apps/mplayerc/mpcresources/rcfile.pl
index 48778d000..6d8487293 100644
--- a/src/apps/mplayerc/mpcresources/rcfile.pl
+++ b/src/apps/mplayerc/mpcresources/rcfile.pl
@@ -19,7 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# Apply mplayerc.rc file changes to locale rc files, and generate patch files for translators.
+# Apply mplayerc.rc file changes to locale rc files.
#
# To use this program, you need a perl with PerlIO package installed.
# For help of usage, type: perl rcfile.pl -h
@@ -36,21 +36,19 @@ require "common.pl";
my $BaseFileName = "../mplayerc.rc";
my $NewFileName = "../mplayerc.rc";
-my $Extension=".txt";
my $help;
-my $result = GetOptions("base|b=s" =>\$BaseFileName, "new|n=s" =>\$NewFileName, "suffix|x=s"=>\$Extension, "help|h"=>\$help);
+my $result = GetOptions("base|b=s" =>\$BaseFileName, "new|n=s" =>\$NewFileName, "help|h"=>\$help);
if($help || !$result) {
print << 'USAGE';
Usage: perl rcfile.pl [Options] | -h --help
Copy all changes between two version of mplayerc.rc files to all rc files in the current directory,
-generate new rc files and texts for translators under the "newrc" subdirectory.
+generate new rc files under the "newrc" subdirectory.
Options:
--base -b base file, default "../mplayerc.rc" optional
--new -n modified file, default "../mplayerc.rc" optional
- --suffix -x output file suffix, default ".txt" optional
--help -h show this help
Base file: the previous revision of mplayerc.rc file
@@ -67,17 +65,18 @@ Options:
Second: >perl rcfile.pl -b mplayerc.rc.old
Or better yet use provided batch file: >rcfile.bat
- After running this script, you will find all new language rc files under "newrc" subdir, along with
- the string text files for translators to translate. These new rc files have all changes copied from your
- modified mplayerc.rc file and is ready to compile, except use english version strings.
- After recieved translated text files, use another script to merge back to rc files.
+ After running this script, you will find all new language rc files under "newrc" subdir.
+ These new rc files have all changes copied from your modified mplayerc.rc file and is ready to compile,
+ except use english version strings. Use rcstrings.pl to extract all strings for translators,
+ After recieved translated text files, use patch.pl script to merge back to rc files.
USAGE
exit(0);
}
my($BaseDialogs, $BaseMenus, $BaseStrings, @BaseOutline) = ({}, {}, {}, ());
my($NewDialogs, $NewMenus, $NewStrings, @NewOutline) = ({}, {}, {}, ());
-my ($MenuDiffs, $DialogDiffs) = ({}, {});
+my($MenuDiffs, $DialogDiffs) = ({}, {});
+my($BaseDesignInfos, $NewDesignInfos) = ({}, {});
my @BaseFile = readFile($BaseFileName, 1);
my @NewFile = readFile($NewFileName, 1);
@@ -91,41 +90,40 @@ getDifference();
#Trace($MenuDiffs, "MenuDiffs");
#Trace($DialogDiffs, "DialogDiffs");
-my @FileLists = <*.rc>;
+my @FileLists = ();
-#put all generted files under newrc sub dir.
+if(@ARGV) { @FileLists = @ARGV; }
+else { @FileLists = <*.rc>; }
+
+#put all generted files under "newrc" sub dir.
if(!-e "newrc"){
- mkdir(File::Spec->catdir(".", "newrc")) || die "Can not create sub directory newrc.";
+ mkdir(File::Spec->catdir(".", "newrc")) || die "Can not create \"newrc\" sub directory.";
}
-
foreach my $filename(@FileLists) {
print "Anaylse locale file: $filename...\n";
my @oldrcfile = readFile($filename, 1);
my($curDialogs, $curMenus, $curStrings, @curOutline) = ({},{},{}, ());
my @curVersionInfo = ();
- analyseData(\@oldrcfile, \@curOutline, $curDialogs, $curMenus, $curStrings, \@curVersionInfo);
-
+ my $curDesignInfos = {};
+ analyseData(\@oldrcfile, \@curOutline, $curDialogs, $curMenus, $curStrings, \@curVersionInfo, $curDesignInfos);
+
my $newrcfile = File::Spec->catfile(".", "newrc", $filename);
- my $txtfile = File::Spec->catfile(".", "newrc", $filename.$Extension);
my @newrc = ();
my @patches = ();
- writeData(\@newrc, \@patches, \@curOutline, $curDialogs, $curMenus, $curStrings, \@curVersionInfo);
+ writeData(\@newrc, \@patches, \@curOutline, $curDialogs, $curMenus, $curStrings, \@curVersionInfo, $curDesignInfos);
- print "Generate new locale file: $newrcfile...\n";
+ print "Generate new locale file: $newrcfile...\n\n";
writeFile($newrcfile, \@newrc, 2);
-
- print "Generate text file to translate: $txtfile...\n\n";
- writePatchFile($txtfile, \@patches, 1);
}
###################################################################################################
sub getDifference {
my @curVersionInfo = (); # no use for mplayerc.rc
- analyseData(\@BaseFile, \@BaseOutline,$BaseDialogs, $BaseMenus, $BaseStrings, \@curVersionInfo);
- analyseData(\@NewFile,\@NewOutline, $NewDialogs, $NewMenus, $NewStrings, \@curVersionInfo);
+ analyseData(\@BaseFile, \@BaseOutline,$BaseDialogs, $BaseMenus, $BaseStrings, \@curVersionInfo, $BaseDesignInfos);
+ analyseData(\@NewFile,\@NewOutline, $NewDialogs, $NewMenus, $NewStrings, \@curVersionInfo, $NewDesignInfos);
while (my ($key, $value) = each(%{$BaseMenus})) {
my $value1 = $NewMenus->{$key};
@@ -143,7 +141,9 @@ sub getDifference {
if($value1) {
my @changeset = ();
- lcs($value->{"__TEXT__"}, $value1->{"__TEXT__"}, \@changeset);
+ my @data0 = map{$_->[1]}@{$value->{"__DATA__"}};
+ my @data1 = map{$_->[1]}@{$value1->{"__DATA__"}};
+ lcs(\@data0, \@data1, \@changeset);
@changeset = @changeset[sort {$changeset[$a][0] <=> $changeset[$b][0];}(0..$#changeset)];
$DialogDiffs->{$key} = [@changeset];
}
@@ -154,9 +154,9 @@ sub getDifference {
#--------------------------------------------------------------------------------------------------
sub writeData {
my ($newrc, $patches) = (shift, shift);
- my ($curOutline, $curDialogs, $curMenus, $curStrings, $curVersionInfo) = @_;
+ my ($curOutline, $curDialogs, $curMenus, $curStrings, $curVersionInfo, $curDesignInfos) = @_;
- my ($curDialogName, $curMenuName);
+ my ($curDialogName, $curMenuName, $curDesignName);
my $headsection = 0;
my $tailsection = $#NewOutline;
@@ -188,6 +188,15 @@ sub writeData {
push(@{$newrc}, @_text); #in general use texts from new rc file
}
}
+ elsif($tag eq "DESIGNINFO") {
+ $curDesignName = $_->[1][0];
+ #if($curDesignInfos->{$curDesignName}) {
+ # push(@{$newrc}, @{$curDesignInfos->{$curDesignName}{"__TEXT__"}}); # use locale design info section
+ #}
+ #else {
+ push(@{$newrc}, @{$NewDesignInfos->{$curDesignName}{"__TEXT__"}}); # use new design info section
+ #}
+ }
elsif($tag eq "BLOCK") {
push(@{$newrc}, @{$_->[1]}); # use new file block section
}
@@ -244,8 +253,6 @@ sub writeStringTable {
my $localeStr = $refs->{$key};
if((!$localeStr) || (!$baseStr) || ($baseStr ne $value)) {
- #new string or changed string or not in locale files, use new one
- push(@{$patches},["STRINGTABLE",{$key=>$value}]);
}
else {
s/\Q$value\E/$localeStr/; #use locale string
@@ -259,59 +266,37 @@ sub writeDialogContent {
my @contents = ();
push(@contents, @{$NewDialogs->{$name}{"__TEXT__"}});
- my $contentLines = @contents;
- if(my $diffData = $DialogDiffs->{$name}) {
- # this dialog exists in old file
- my @changes = grep($_->[0] != $_->[1],@$diffData); #anything changed for this dialog?
- my $samelines = @$diffData;
-
- if((!@changes) && ($samelines == $contentLines)) { #no change then just use old data
- @contents = ();
- push(@contents, @{$refs->{$name}{"__TEXT__"}});
- }
- else { #change in this dialog
- my $curlines = $refs->{$name}{"__LINES__"};
- my $oldlines = $BaseDialogs->{$name}{"__LINES__"};
-
- if($oldlines == $curlines) {
- # if locale rc files have the same line numbers with the original main mplayerc.rc
- # TODO: need some other checks, though errors will be easier to spot.
- my @checkIdx=(1..$contentLines);
-
- my $idx = 0;
- foreach (@$diffData) {
- $contents[$_->[0]] = $refs->{$name}{"__TEXT__"}[$_->[1]]; #use those values from locale file
- $checkIdx[$_->[0]] = 0;
- }
+ my @newdatas = map{$_->[1]}@{$NewDialogs->{$name}{"__DATA__"}};
+ my @newidxs = map{$_->[0]}@{$NewDialogs->{$name}{"__DATA__"}};
+ my $newdataLines = @newdatas;
- @checkIdx=grep($_>0, @checkIdx); #the rest from new fc file, also put in patches
- my @data = grep{
- my $i=0;
- foreach $idx(@checkIdx) {
- if($_->[0]==$idx){
- $i = 1;
- last;
- }
- }
- $i;
- }@{$NewDialogs->{$name}{"__DATA__"}};
+ my @baseidxs = map{$_->[0]}@{$BaseDialogs->{$name}{"__DATA__"}};
+ my $basedataLines = @baseidxs;
- if(@data) {
- push(@{$patches}, ["DIALOG", {$name => [@data], "__LINES__" => $contentLines}]);
- }
- }
- else {
- # if locale rc files have different line numbers with original main mplayerc.rc,
- # don't try to use locale values, just use english version and to patch file
- push(@{$patches}, ["DIALOG",{$name =>$NewDialogs->{$name}{"__DATA__"}, "__LINES__" => $contentLines}]);
+ my @refdatas = map{$_->[1]}@{$refs->{$name}{"__DATA__"}};
+ my $refdataLines = @refdatas;
+
+ if($newdataLines && $basedataLines && $refdataLines) {
+ my $diffData = $DialogDiffs->{$name};
+
+ foreach(@$diffData) {
+ my $linenum = $newidxs[$_->[0]];
+
+ my $str = $newdatas[$_->[0]];
+ my $localstr = $refdatas[$_->[1]];
+
+ if($localstr) {
+ $contents[$linenum-1] =~ s/\Q$str\E/$localstr/;
}
}
}
- else { #new dialog, use english version
- push(@{$patches}, ["DIALOG",{$name =>$NewDialogs->{$name}{"__DATA__"}, "__LINES__" => $contentLines}]); #new dialog
- }
+ my $localfont = $refs->{$name}{"__FONT__"}[1];
+ if($localfont) {
+ $contents[$NewDialogs->{$name}{"__FONT__"}[0]-1] = $refs->{$name}{"__TEXT__"}[$refs->{$name}{"__FONT__"}[0]-1];
+ }
+
push(@{$output}, @contents);
}
@@ -339,27 +324,8 @@ sub writeMenuContent {
$contents[$_->[0]] = $refs->{$name}{"__TEXT__"}[$_->[1]]; #first use those values from locale file
$checkIdx[$_->[0]] = 0;
}
-
- @checkIdx=grep($_>0, @checkIdx);
- my @data = grep{
- my $i=0;
- foreach my $idx(@checkIdx) {
- if($_->[0]==$idx){
- $i = 1;
- last;
- }
- }
- $i;
- }@{$NewMenus->{$name}{"__DATA__"}};
-
- if(@data) {
- push(@{$patches}, ["MENU", {$name => [@data], "__LINES__" => $contentLines }]);
- }
}
}
- else {
- push(@{$patches}, ["MENU", {$name => $NewMenus->{$name}{"__DATA__"}, "__LINES__" => $contentLines }]); #new menu
- }
push(@{$output}, @contents);
}
@@ -380,52 +346,4 @@ sub writeVersionInfo{
push(@{$input}, "");
}
-#--------------------------------------------------------------------------------------------------
-sub writePatchFile {
- my ($output, $data, $withBOM) = @_;
-
- my @localData = ();
- foreach (@$data) {
- if($_->[0] eq "DIALOG") {
- my $lines = $_->[1]{"__LINES__"};
- while (my($key, $value)=each(%{$_->[1]})) {
- if($key eq "__LINES__") {
- next;
- }
- else {
- push(@localData, "BEGIN DIALOGEX ".$key." LINES $lines");
- foreach my $pair(@{$value}){
- push(@localData, "$pair->[0]\t\t$pair->[1]");
- }
- }
- }
- push(@localData, "END");
- push(@localData, "");
- }
- elsif($_->[0] eq "STRINGTABLE") {
- my($key, $value)=each(%{$_->[1]});
- push(@localData, "STRING $key\t\t$value");
- push(@localData, "");
- }
- elsif($_->[0] eq "MENU") {
- my $lines = $_->[1]{"__LINES__"};
- while (my($key, $value)=each(%{$_->[1]})) {
- if($key eq "__LINES__") {
- next;
- }
- else {
- push(@localData, "BEGIN MENU ".$key. " LINES $lines");
- foreach my $pair(@{$value}){
- push(@localData, "$pair->[0]\t\t$pair->[1]");
- }
- }
- }
- push(@localData, "END");
- push(@localData, "");
- }
- }
-
- writeFile($output, \@localData, $withBOM);
-}
-
###################################################################################################
diff --git a/src/apps/mplayerc/mpcresources/rcstrings.bat b/src/apps/mplayerc/mpcresources/rcstrings.bat
new file mode 100644
index 000000000..0b6778ce8
--- /dev/null
+++ b/src/apps/mplayerc/mpcresources/rcstrings.bat
@@ -0,0 +1,7 @@
+@echo off
+
+rem A simple script demos how to extract all strings from rc files.
+
+echo Generating string files...
+perl rcstrings.pl -a
+pause \ No newline at end of file
diff --git a/src/apps/mplayerc/mpcresources/rcstrings.pl b/src/apps/mplayerc/mpcresources/rcstrings.pl
new file mode 100644
index 000000000..69b696a40
--- /dev/null
+++ b/src/apps/mplayerc/mpcresources/rcstrings.pl
@@ -0,0 +1,129 @@
+#/bin/perl
+#
+# $Id$
+#
+# (C) 2006-2010 see AUTHORS
+#
+# This file is part of mplayerc.
+#
+# Mplayerc is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Mplayerc is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Extract all translatable strings from rc files.
+#
+# To use this program, you need a perl with PerlIO package installed.
+# For help of usage, type: perl rcstrings.pl -h
+#
+
+use strict;
+use Getopt::Long;
+use vars qw(@InTags @TextTags);
+
+use File::Basename;
+use File::Spec;
+use File::Glob qw(:globally :nocase);
+require "common.pl";
+
+my $Extension=".txt";
+my $help;
+my ($OutputAll, $OutputDialogs, $OutputMenus, $OutputStringtables);
+
+my $result = GetOptions("suffix|x=s"=>\$Extension, "help|h"=>\$help, "all|a"=>\$OutputAll,
+ "dialog|d"=>\$OutputDialogs, "menu|m"=>\$OutputMenus, "stringtable|s"=>\$OutputStringtables);
+
+if($OutputAll) {
+ ($OutputDialogs, $OutputMenus, $OutputStringtables) = (1,1,1);
+}
+
+if($help || !$result) {
+ print << 'USAGE';
+Usage: perl rcstrings.pl [Options] file1 file2 | -h --help
+Extract all translatable strings from file1 file2 or all rc files.
+
+Options:
+ --suffix -x output file suffix, default ".txt" optional
+ --help -h show this help
+
+ -all -a output all strings, including dialogs, menus, stringtables
+ -dialog -d output dialogs
+ -menu -m output menus
+ -stringtable -s output stringtables
+
+ After running this script, you will find all the string text files under "text" sub directory.
+USAGE
+ exit(0);
+}
+
+my @FileLists = ();
+
+if(@ARGV) { @FileLists = @ARGV; }
+else { @FileLists = <*.rc>; }
+
+#put all generated files under text sub dir.
+if(!-e "text"){
+ mkdir(File::Spec->catdir(".", "text")) || die "Can not create \"text\" sub directory.";
+}
+
+foreach my $filename(@FileLists) {
+ print "Anaylse locale file: $filename...\n";
+ my @rcfile = readFile($filename, 1);
+ my($curDialogs, $curMenus, $curStrings, @curOutline) = ({},{},{}, ());
+ my @curVersionInfo = ();
+ my $curDesignInfos = {};
+ analyseData(\@rcfile, \@curOutline, $curDialogs, $curMenus, $curStrings, \@curVersionInfo, $curDesignInfos);
+
+ my $txtfile = File::Spec->catfile(".", "text", $filename.$Extension);
+
+ writeFileStrings($txtfile, $curDialogs, $curMenus, $curStrings);
+}
+
+###################################################################################################
+sub writeFileStrings {
+ my ($filename, $dialogs, $menus, $strings) = @_;
+ my @contents = ();
+
+ if($OutputDialogs) {
+ foreach (sort(keys(%{$dialogs}))) {
+ my @data = ();
+ push(@data, @{$dialogs->{$_}{"__DATA__"}});
+ if(defined($data[0])) {
+ push(@contents, ["DIALOG", {$_ =>[@data], "__LINES__" => $dialogs->{$_}{"__LINES__"}}]);
+ }
+ }
+ }
+ if($OutputMenus) {
+ foreach (sort(keys(%{$menus}))) {
+ my @data = ();
+ push(@data, @{$menus->{$_}{"__DATA__"}});
+ @data = grep(skipNonTranslatedStr($_->[1]), @data);
+ @data = grep(($_->[1] !~/""/),@data);
+ push(@contents, ["MENU",{$_ =>[@data], "__LINES__" => $menus->{$_}{"__LINES__"}}]);
+ }
+ }
+ if($OutputStringtables) {
+ foreach (sort(keys(%{$strings}))) {
+ my $line = $strings->{$_};
+ $line = skipNonTranslatedStr($line);
+ if($line) {
+ push(@contents,["STRINGTABLE",{$_=>$strings->{$_}}]);
+ }
+ }
+ }
+
+ if(@contents) {
+ print "Generate string files $filename...\n";
+ writePatchFile($filename, \@contents, 1);
+ }
+}
+
+###################################################################################################
diff --git a/src/filters/reader/UDPReader/UDPReader.cpp b/src/filters/reader/UDPReader/UDPReader.cpp
index 1875cb4ea..d1fc5e25d 100644
--- a/src/filters/reader/UDPReader/UDPReader.cpp
+++ b/src/filters/reader/UDPReader/UDPReader.cpp
@@ -129,7 +129,7 @@ STDMETHODIMP CUDPReader::GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt)
CUDPStream::CUDPStream()
{
m_port = 0;
- m_socket = (SOCKET)-1;
+ m_socket = INVALID_SOCKET;
m_subtype = MEDIASUBTYPE_NULL;
}
@@ -140,7 +140,7 @@ CUDPStream::~CUDPStream()
void CUDPStream::Clear()
{
- if(m_socket >= 0) {closesocket(m_socket); m_socket = (SOCKET)-1;}
+ if(m_socket !=INVALID_SOCKET) {closesocket(m_socket); m_socket = INVALID_SOCKET;}
if(CAMThread::ThreadExists())
{
CAMThread::CallWorker(CMD_EXIT);
@@ -324,22 +324,22 @@ DWORD CUDPStream::ThreadProc()
imr.imr_multiaddr.s_addr = inet_addr(CStringA(m_ip));
imr.imr_interface.s_addr = INADDR_ANY;
- if((m_socket = socket(AF_INET, SOCK_DGRAM, 0)) >= 0)
+ if((m_socket = socket(AF_INET, SOCK_DGRAM, 0))!=INVALID_SOCKET)
{
/* u_long argp = 1;
ioctlsocket(m_socket, FIONBIO, &argp);
*/
DWORD dw = TRUE;
- if(setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&dw, sizeof(dw)) < 0)
+ if(setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&dw, sizeof(dw))==SOCKET_ERROR)
{
closesocket(m_socket);
- m_socket = (SOCKET)-1;
+ m_socket = INVALID_SOCKET;
}
- if(bind(m_socket, (struct sockaddr*)&addr, sizeof(addr)) < 0)
+ if(bind(m_socket, (struct sockaddr*)&addr, sizeof(addr))==SOCKET_ERROR)
{
closesocket(m_socket);
- m_socket = (SOCKET)-1;
+ m_socket = INVALID_SOCKET;
}
if(IN_MULTICAST(htonl(imr.imr_multiaddr.s_addr)))
@@ -352,10 +352,12 @@ DWORD CUDPStream::ThreadProc()
SetThreadPriority(m_hThread, THREAD_PRIORITY_TIME_CRITICAL);
+#ifdef _DEBUG
FILE* dump = NULL;
// dump = _tfopen(_T("c:\\udp.ts"), _T("wb"));
FILE* log = NULL;
// log = _tfopen(_T("c:\\udp.txt"), _T("wt"));
+#endif
while(1)
{
@@ -365,14 +367,16 @@ DWORD CUDPStream::ThreadProc()
{
default:
case CMD_EXIT:
- if(m_socket >= 0) {closesocket(m_socket); m_socket = (SOCKET)-1;}
+ if(m_socket!=INVALID_SOCKET) {closesocket(m_socket); m_socket = INVALID_SOCKET;}
WSACleanup();
+#ifdef _DEBUG
if(dump) fclose(dump);
if(log) fclose(log);
+#endif
Reply(S_OK);
return 0;
case CMD_RUN:
- Reply(m_socket >= 0 ? S_OK : E_FAIL);
+ Reply(m_socket!=INVALID_SOCKET ? S_OK : E_FAIL);
{
char buff[65536*2];
@@ -390,6 +394,7 @@ DWORD CUDPStream::ThreadProc()
int len = recvfrom(m_socket, &buff[buffsize], 65536, 0, (SOCKADDR*)&addr, &fromlen);
if(len <= 0) {Sleep(1); continue;}
+#ifdef _DEBUG
if(log)
{
if(buffsize >= len && !memcmp(&buff[buffsize-len], &buff[buffsize], len))
@@ -399,11 +404,13 @@ DWORD CUDPStream::ThreadProc()
_ftprintf(log, _T("%04d %2d DUP\n"), pid, counter);
}
}
+#endif
buffsize += len;
if(buffsize >= 65536 || m_len == 0)
{
+#ifdef _DEBUG
if(dump)
{
fwrite(buff, buffsize, 1, dump);
@@ -424,6 +431,7 @@ DWORD CUDPStream::ThreadProc()
pid2counter[pid] = counter;
}
}
+#endif
Append((BYTE*)buff, buffsize);
buffsize = 0;
@@ -435,7 +443,7 @@ DWORD CUDPStream::ThreadProc()
}
ASSERT(0);
- return (SOCKET)-1;
+ return (DWORD)-1;
}
CUDPStream::packet_t::packet_t(BYTE* p, __int64 start, __int64 end)
diff --git a/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp b/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp
index f9ba3dfd2..7a75a2768 100644
--- a/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp
+++ b/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp
@@ -493,7 +493,9 @@ HRESULT CStreamSwitcherInputPin::CompleteConnect(IPin* pReceivePin)
CStringW fn = fileName.Mid(fileName.ReverseFind('/')+1);
if(!fn.IsEmpty()) fileName = fn;
- if(!pinName.IsEmpty()) fileName = pinName;
+ // Haali & LAVFSplitter return only one "Audio" pin name, cause CMainFrame::OnInitMenuPopup lookup find the wrong popmenu,
+ // add space at the end to prevent this, internal filter never return "Audio" only.
+ if(!pinName.IsEmpty()) fileName = pinName + L" ";
WCHAR* pName = DNew WCHAR[fileName.GetLength()+1];
if(pName)
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/config.h b/src/filters/transform/MPCVideoDec/ffmpeg/config.h
index 5ca6a5486..65a777263 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/config.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/config.h
@@ -79,6 +79,7 @@
#define ARCH_SPARC64 0
#define ARCH_TOMI 0
+#define HAVE_ALIGNED_STACK 0
#define HAVE_ALTIVEC 0
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/custom_code.txt b/src/filters/transform/MPCVideoDec/ffmpeg/custom_code.txt
index 564cc184f..cd0b76ee0 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/custom_code.txt
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/custom_code.txt
@@ -7,7 +7,6 @@ The following files have MPC-specific custom code (compared to ffdshow):
* libavcodec/allcodecs.c
* libavcodec/bitstream.c
* libavcodec/CompilatorVersion.c
-* libavcodec/dsputil.c
* libavcodec/dxva.h
* libavcodec/h264.c
* libavcodec/mpc_helper.c
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
index c5f35eda2..61e6c5620 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
@@ -45,8 +45,8 @@
#include "libavutil/cpu.h"
#define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 87
-#define LIBAVCODEC_VERSION_MICRO 5
+#define LIBAVCODEC_VERSION_MINOR 91
+#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
@@ -68,6 +68,9 @@
#ifndef FF_API_MM_FLAGS
#define FF_API_MM_FLAGS (LIBAVCODEC_VERSION_MAJOR < 53)
#endif
+#ifndef FF_API_OPT_SHOW
+#define FF_API_OPT_SHOW (LIBAVCODEC_VERSION_MAJOR < 53)
+#endif
#define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
#define AV_TIME_BASE 1000000
@@ -3099,6 +3102,8 @@ typedef struct AVCodecParserContext {
int flags;
#define PARSER_FLAG_COMPLETE_FRAMES 0x0001
#define PARSER_FLAG_ONCE 0x0002
+/// Set if the parser has a valid file offset
+#define PARSER_FLAG_FETCHED_OFFSET 0x0004
int64_t offset; ///< byte offset from starting packet start
int64_t cur_frame_end[AV_PARSER_PTS_NB];
@@ -3293,15 +3298,15 @@ void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size);
*/
attribute_deprecated void av_free_static(void);
+#if LIBAVCODEC_VERSION_MAJOR < 53
/**
- * Copy image data in src_data to dst_data.
- *
- * @param dst_linesize linesizes for the image in dst_data
- * @param src_linesize linesizes for the image in src_data
+ * @deprecated Deprecated in favor of av_image_copy().
*/
+attribute_deprecated
void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4],
uint8_t *src_data[4], int src_linesize[4],
enum PixelFormat pix_fmt, int width, int height);
+#endif
/**
* Copy image src to dst. Wraps av_picture_data_copy() above.
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.h
index 3899af4cf..ed4e7511c 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.h
@@ -65,14 +65,14 @@ static inline int get_ue_golomb(GetBitContext *gb){
OPEN_READER(re, gb);
/* ffdshow custom code */
- #if defined(__INTEL_COMPILER) || defined(DEBUG)
+ #if defined (__INTEL_COMPILER) && __INTEL_COMPILER < 1100 || defined (DEBUG)
#ifdef ALT_BITSTREAM_READER_LE
re_cache= AV_RL32( ((const uint8_t *)(gb)->buffer)+(re_index>>3) ) >> (re_index&0x07);
#else
re_cache= AV_RB32( ((const uint8_t *)(gb)->buffer)+(re_index>>3) ) >> (re_index&0x07);
#endif
#else
- // ICL9.1-Release and MSVC8-DEBUG build can't process this macro properly.
+ // ICL9.1-Release, ICL10.1 and MSVC8-DEBUG build can't process this macro properly.
UPDATE_CACHE(re, gb);
#endif
buf=GET_CACHE(re, gb);
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c
index 7ab3e6311..260d9460c 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c
@@ -25,6 +25,7 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
+#include "libavcore/imgutils.h"
#include "internal.h"
#include "dsputil.h"
#include "avcodec.h"
@@ -1836,6 +1837,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
if(h0->current_slice == 0){
while(h->frame_num != h->prev_frame_num &&
h->frame_num != (h->prev_frame_num+1)%(1<<h->sps.log2_max_frame_num)){
+ Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL;
av_log(h->s.avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->frame_num, h->prev_frame_num);
if (ff_h264_frame_start(h) < 0)
return -1;
@@ -1844,6 +1846,21 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
s->current_picture_ptr->frame_num= h->prev_frame_num;
ff_generate_sliding_window_mmcos(h);
ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
+ /* Error concealment: if a ref is missing, copy the previous ref in its place.
+ * FIXME: avoiding a memcpy would be nice, but ref handling makes many assumptions
+ * about there being no actual duplicates.
+ * FIXME: this doesn't copy padding for out-of-frame motion vectors. Given we're
+ * concealing a lost frame, this probably isn't noticable by comparison, but it should
+ * be fixed. */
+ if (h->short_ref_count) {
+ if (prev) {
+ av_image_copy(h->short_ref[0]->data, h->short_ref[0]->linesize,
+ (const uint8_t**)prev->data, prev->linesize,
+ PIX_FMT_YUV420P, s->mb_width*16, s->mb_height*16);
+ h->short_ref[0]->poc = prev->poc+2;
+ }
+ h->short_ref[0]->frame_num = h->prev_frame_num;
+ }
}
/* See if we have a decoded first field looking for a pair... */
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpegvideo.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpegvideo.c
index 489c66f1d..c4d0b085f 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpegvideo.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpegvideo.c
@@ -164,6 +164,18 @@ av_cold int ff_dct_common_init(MpegEncContext *s)
#if HAVE_MMX
MPV_common_init_mmx(s);
+#elif ARCH_ALPHA
+ MPV_common_init_axp(s);
+#elif CONFIG_MLIB
+ MPV_common_init_mlib(s);
+#elif HAVE_MMI
+ MPV_common_init_mmi(s);
+#elif ARCH_ARM
+ MPV_common_init_arm(s);
+#elif HAVE_ALTIVEC
+ MPV_common_init_altivec(s);
+#elif ARCH_BFIN
+ MPV_common_init_bfin(s);
#endif
/* load & permutate scantables
@@ -485,7 +497,7 @@ av_cold int MPV_common_init(MpegEncContext *s)
return -1;
}
- if((s->width || s->height) && av_check_image_size(s->width, s->height, 0, s->avctx))
+ if((s->width || s->height) && av_image_check_size(s->width, s->height, 0, s->avctx))
return -1;
dsputil_init(&s->dsp, s->avctx);
@@ -1081,6 +1093,7 @@ void MPV_frame_end(MpegEncContext *s)
*/
void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
+ /* ffdshow custom code */
if(!pict || !pict->mb_type) return;
if (s->avctx->debug_mv && pict->motion_val) {
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/parser.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/parser.c
index ed26dd603..04084dd07 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/parser.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/parser.c
@@ -150,6 +150,12 @@ int av_parser_parse2(AVCodecParserContext *s,
int index, i;
uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE];
+ if(!(s->flags & PARSER_FLAG_FETCHED_OFFSET)) {
+ s->next_frame_offset =
+ s->cur_offset = pos;
+ s->flags |= PARSER_FLAG_FETCHED_OFFSET;
+ }
+
if (buf_size == 0) {
/* padding is always necessary even if EOF, so we add it here */
memset(dummy_buf, 0, sizeof(dummy_buf));
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
index bf624cdc9..038542eba 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
@@ -740,6 +740,17 @@ unsigned avcodec_version( void )
return LIBAVCODEC_VERSION_INT;
}
+const char *avcodec_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char *avcodec_license(void)
+{
+#define LICENSE_PREFIX "libavcodec license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+
void avcodec_init(void)
{
static int initialized = 0;
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.c
index c9ea233ed..4e7298f61 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.c
@@ -306,13 +306,17 @@ int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitConte
{
v->zz_8x4 = wmv2_scantableA;
v->zz_4x8 = wmv2_scantableB;
- v->res_sm = get_bits(gb, 2); //reserved
- if (v->res_sm)
+ v->res_y411 = get_bits1(gb);
+ v->res_sprite = get_bits1(gb);
+ if (v->res_y411)
{
av_log(avctx, AV_LOG_ERROR,
- "Reserved RES_SM=%i is forbidden\n", v->res_sm);
+ "Old interlaced mode is not supported\n");
return -1;
}
+ if (v->res_sprite) {
+ av_log(avctx, AV_LOG_ERROR, "WMVP is not fully supported\n");
+ }
}
// (fps-2)/4 (->30)
@@ -382,7 +386,21 @@ int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitConte
v->quantizer_mode = get_bits(gb, 2); //common
v->finterpflag = get_bits1(gb); //common
- v->res_rtm_flag = get_bits1(gb); //reserved
+
+ if (v->res_sprite) {
+ v->s.avctx->width = v->s.avctx->coded_width = get_bits(gb, 11);
+ v->s.avctx->height = v->s.avctx->coded_height = get_bits(gb, 11);
+ skip_bits(gb, 5); //frame rate
+ v->res_x8 = get_bits1(gb);
+ if (get_bits1(gb)) { // something to do with DC VLC selection
+ av_log(avctx, AV_LOG_ERROR, "Unsupported sprite feature\n");
+ return -1;
+ }
+ skip_bits(gb, 3); //slice code
+ v->res_rtm_flag = 0;
+ } else {
+ v->res_rtm_flag = get_bits1(gb); //reserved
+ }
if (!v->res_rtm_flag)
{
// av_log(avctx, AV_LOG_ERROR,
@@ -561,6 +579,9 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
{
int pqindex, lowquant, status;
+ if(v->res_sprite) {
+ skip_bits(gb, 2); //not yet deciphered
+ }
if(v->finterpflag) v->interpfrm = get_bits1(gb);
skip_bits(gb, 2); //framecnt unused
v->rangeredfrm = 0;
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.h
index 24921dd5e..104c26e53 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1.h
@@ -160,7 +160,8 @@ typedef struct VC1Context{
/** Simple/Main Profile sequence header */
//@{
- int res_sm; ///< reserved, 2b
+ int res_sprite; ///< reserved, sprite mode
+ int res_y411; ///< reserved, old interlaced mode
int res_x8; ///< reserved
int multires; ///< frame-level RESPIC syntax element present
int res_fasttx; ///< reserved, always 1
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1dec.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1dec.c
index fe960473f..7f1f0884e 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1dec.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vc1dec.c
@@ -3227,6 +3227,11 @@ static int vc1_decode_frame(AVCodecContext *avctx,
}
}
+ if(v->res_sprite && (s->pict_type!=FF_I_TYPE)){
+ av_free(buf2);
+ return -1;
+ }
+
// for hurry_up==5
s->current_picture.pict_type= s->pict_type;
s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/dsputil_mmx.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/dsputil_mmx.c
index 995df0564..ac68a6836 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/dsputil_mmx.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/dsputil_mmx.c
@@ -2818,6 +2818,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
if((mm_flags & AV_CPU_FLAG_SSE2) && !(mm_flags & AV_CPU_FLAG_3DNOW)){
// these functions are slower than mmx on AMD, but faster on Intel
c->put_pixels_tab[0][0] = put_pixels16_sse2;
+ c->put_no_rnd_pixels_tab[0][0] = put_pixels16_sse2;
c->avg_pixels_tab[0][0] = avg_pixels16_sse2;
H264_QPEL_FUNCS(0, 0, sse2);
}
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/fft_mmx.asm b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/fft_mmx.asm
index b75ec0cc5..1dcd62918 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/fft_mmx.asm
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/fft_mmx.asm
@@ -154,9 +154,9 @@ IF%1 mova m5, Z(5)
mova m1, %3 ; wim
mova m3, m5
mulps m2, m0 ; r2*wre
-IF%1 mova m6, Z(6)
+IF%1 mova m6, Z2(6)
mulps m3, m1 ; i2*wim
-IF%1 mova m7, Z(7)
+IF%1 mova m7, Z2(7)
mulps m4, m1 ; r2*wim
mulps m5, m0 ; i2*wre
addps m2, m3 ; r2*wre + i2*wim
@@ -183,14 +183,14 @@ IF%1 mova m7, Z(7)
mova m4, m6
subps m6, m5 ; r3
addps m5, m4 ; r1
- mova Z(6), m6
+ mova Z2(6), m6
mova Z(2), m5
mova m2, Z(3)
addps m3, m0 ; t6
subps m2, m1 ; i3
mova m7, Z(1)
addps m1, Z(3) ; i1
- mova Z(7), m2
+ mova Z2(7), m2
mova Z(3), m1
mova m4, m7
subps m7, m3 ; i2
@@ -208,9 +208,9 @@ IF%1 mova m7, Z(7)
mova m3, m5
mova m1, [wq+o1q] ; wim
mulps m2, m0 ; r2*wre
- mova m6, Z(6) ; r3
+ mova m6, Z2(6) ; r3
mulps m3, m1 ; i2*wim
- mova m7, Z(7) ; i3
+ mova m7, Z2(7) ; i3
mulps m4, m1 ; r2*wim
mulps m5, m0 ; i2*wre
addps m2, m3 ; r2*wre + i2*wim
@@ -237,14 +237,14 @@ IF%1 mova m7, Z(7)
mova m4, m6
subps m6, m5 ; r3
addps m5, m4 ; r1
-IF%1 mova Z(6), m6
+IF%1 mova Z2(6), m6
IF%1 mova Z(2), m5
mova m2, Z(3)
addps m3, m0 ; t6
subps m2, m1 ; i3
mova m7, Z(1)
addps m1, Z(3) ; i1
-IF%1 mova Z(7), m2
+IF%1 mova Z2(7), m2
IF%1 mova Z(3), m1
mova m4, m7
subps m7, m3 ; i2
@@ -262,8 +262,8 @@ IF%1 mova Z(1), m3
mova m2, Z(4)
mova Z(2), m5
mova Z(3), m4
- mova Z(6), m6
- mova Z(7), m0
+ mova Z2(6), m6
+ mova Z2(7), m0
mova m5, m1 ; r0
mova m4, m2 ; r2
unpcklps m1, m3
@@ -287,6 +287,7 @@ INIT_XMM
%define mova movaps
%define Z(x) [r0+mmsize*x]
+%define Z2(x) [r0+mmsize*x]
align 16
fft4_sse:
@@ -326,8 +327,8 @@ fft16_sse:
mova Z(2), m2
mova Z(3), m3
T4_SSE m4, m5, m6
- mova m6, Z(6)
- mova m7, Z(7)
+ mova m6, Z2(6)
+ mova m7, Z2(7)
T4_SSE m6, m7, m0
PASS_SMALL 0, [cos_16], [cos_16+16]
ret
@@ -358,8 +359,8 @@ fft8%1:
T4_3DN m0, m1, m2, m3, m4, m5
mova Z(0), m0
mova Z(2), m2
- T2_3DN m4, m5, Z(4), Z(5)
- T2_3DN m6, m7, Z(6), Z(7)
+ T2_3DN m4, m5, Z(4), Z(5)
+ T2_3DN m6, m7, Z2(6), Z2(7)
pswapd m0, m5
pswapd m2, m7
pxor m0, [ps_m1p1]
@@ -370,7 +371,7 @@ fft8%1:
pfmul m7, [ps_root2]
T4_3DN m1, m3, m5, m7, m0, m2
mova Z(5), m5
- mova Z(7), m7
+ mova Z2(7), m7
mova m0, Z(0)
mova m2, Z(2)
T4_3DN m0, m2, m4, m6, m5, m7
@@ -380,12 +381,12 @@ fft8%1:
mova Z(1), m5
mova Z(2), m2
mova Z(3), m7
- PUNPCK m4, Z(5), m5
- PUNPCK m6, Z(7), m7
+ PUNPCK m4, Z(5), m5
+ PUNPCK m6, Z2(7), m7
mova Z(4), m4
mova Z(5), m5
- mova Z(6), m6
- mova Z(7), m7
+ mova Z2(6), m6
+ mova Z2(7), m7
ret
%endmacro
@@ -405,7 +406,8 @@ FFT48_3DN _3dn2
FFT48_3DN _3dn
-%define Z(x) [zq + o1q*(x&6)*((x/6)^1) + o3q*(x/6) + mmsize*(x&1)]
+%define Z(x) [zq + o1q*(x&6) + mmsize*(x&1)]
+%define Z2(x) [zq + o3q + mmsize*(x&1)]
%macro DECL_PASS 2+ ; name, payload
align 16
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264_idct.asm b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264_idct.asm
index 3311ab559..9c154f80b 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264_idct.asm
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264_idct.asm
@@ -245,12 +245,12 @@ cglobal h264_idct8_add_sse2, 3, 4, 10
movsx %1, word [%1]
add %1, 32
sar %1, 6
- movd m0, %1
+ movd m0, %1d
lea %1, [%2*3]
%else
add %3, 32
sar %3, 6
- movd m0, %3
+ movd m0, %3d
lea %3, [%2*3]
%endif
pshufw m0, m0, 0
@@ -759,107 +759,98 @@ cglobal h264_idct_add16_sse2, 5, 5, 8
add16_sse2_cycle 7, 0x26
RET
-; ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset,
-; DCTELEM *block, int stride, const uint8_t nnzc[6*8])
-cglobal h264_idct_add16intra_sse2, 5, 7, 8
- xor r5, r5
-%ifdef ARCH_X86_64
- mov r10, r0
-%endif
-%ifdef PIC
- lea r11, [scan8_mem]
-%endif
-.next2blocks
- movzx r0, byte [scan8+r5]
- movzx r0, word [r4+r0]
+%macro add16intra_sse2_cycle 2
+ movzx r0, word [r4+%2]
test r0, r0
- jz .try_dc
- mov r0d, dword [r1+r5*4]
+ jz .try%1dc
+ mov r0d, dword [r1+%1*8]
%ifdef ARCH_X86_64
add r0, r10
%else
add r0, r0m
%endif
call x264_add8x4_idct_sse2
- add r5, 2
- add r2, 64
- cmp r5, 16
- jl .next2blocks
- REP_RET
-.try_dc
+ jmp .cycle%1end
+.try%1dc
movsx r0, word [r2 ]
or r0w, word [r2+32]
- jz .skip2blocks
- mov r0d, dword [r1+r5*4]
+ jz .cycle%1end
+ mov r0d, dword [r1+%1*8]
%ifdef ARCH_X86_64
add r0, r10
%else
add r0, r0m
%endif
call h264_idct_dc_add8_mmx2
-.skip2blocks
- add r5, 2
+.cycle%1end
+%if %1 < 7
add r2, 64
- cmp r5, 16
- jl .next2blocks
- REP_RET
+%endif
+%endmacro
-h264_idct_add8_sse2_plane:
-.next2blocks
- movzx r0, byte [scan8+r5]
- movzx r0, word [r4+r0]
+; ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset,
+; DCTELEM *block, int stride, const uint8_t nnzc[6*8])
+cglobal h264_idct_add16intra_sse2, 5, 7, 8
+%ifdef ARCH_X86_64
+ mov r10, r0
+%endif
+ add16intra_sse2_cycle 0, 0xc
+ add16intra_sse2_cycle 1, 0x14
+ add16intra_sse2_cycle 2, 0xe
+ add16intra_sse2_cycle 3, 0x16
+ add16intra_sse2_cycle 4, 0x1c
+ add16intra_sse2_cycle 5, 0x24
+ add16intra_sse2_cycle 6, 0x1e
+ add16intra_sse2_cycle 7, 0x26
+ RET
+
+%macro add8_sse2_cycle 2
+ movzx r0, word [r4+%2]
test r0, r0
- jz .try_dc
+ jz .try%1dc
%ifdef ARCH_X86_64
- mov r0d, dword [r1+r5*4]
+ mov r0d, dword [r1+%1*8+64]
add r0, [r10]
%else
- mov r0, r1m ; XXX r1m here is actually r0m of the calling func
+ mov r0, r0m
mov r0, [r0]
- add r0, dword [r1+r5*4]
+ add r0, dword [r1+%1*8+64]
%endif
call x264_add8x4_idct_sse2
- add r5, 2
- add r2, 64
- test r5, 3
- jnz .next2blocks
- rep ret
-.try_dc
+ jmp .cycle%1end
+.try%1dc
movsx r0, word [r2 ]
or r0w, word [r2+32]
- jz .skip2blocks
+ jz .cycle%1end
%ifdef ARCH_X86_64
- mov r0d, dword [r1+r5*4]
+ mov r0d, dword [r1+%1*8+64]
add r0, [r10]
%else
- mov r0, r1m ; XXX r1m here is actually r0m of the calling func
+ mov r0, r0m
mov r0, [r0]
- add r0, dword [r1+r5*4]
+ add r0, dword [r1+%1*8+64]
%endif
call h264_idct_dc_add8_mmx2
-.skip2blocks
- add r5, 2
+.cycle%1end
+%if %1 < 3
add r2, 64
- test r5, 3
- jnz .next2blocks
- rep ret
+%endif
+%endmacro
; ff_h264_idct_add8_sse2(uint8_t **dest, const int *block_offset,
; DCTELEM *block, int stride, const uint8_t nnzc[6*8])
cglobal h264_idct_add8_sse2, 5, 7, 8
- mov r5, 16
add r2, 512
-%ifdef PIC
- lea r11, [scan8_mem]
-%endif
%ifdef ARCH_X86_64
mov r10, r0
%endif
- call h264_idct_add8_sse2_plane
+ add8_sse2_cycle 0, 0x09
+ add8_sse2_cycle 1, 0x11
%ifdef ARCH_X86_64
add r10, gprsize
%else
add r0mp, gprsize
%endif
- call h264_idct_add8_sse2_plane
+ add8_sse2_cycle 2, 0x21
+ add8_sse2_cycle 3, 0x29
RET
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c
index efd8b78f1..c3c962ad9 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c
@@ -24,7 +24,6 @@
#include "dsputil_mmx.h"
DECLARE_ALIGNED(8, static const uint64_t, ff_pb_3_1 ) = 0x0103010301030103ULL;
-DECLARE_ALIGNED(8, static const uint64_t, ff_pb_7_3 ) = 0x0307030703070307ULL;
/***********************************/
/* IDCT */
@@ -64,9 +63,122 @@ void ff_h264_idct_add8_sse2 (uint8_t **dest, const int *block_offset, DCTEL
/***********************************/
/* deblocking */
+#define h264_loop_filter_strength_iteration_mmx2(bS, nz, ref, mv, bidir, edges, step, mask_mv, dir, d_idx, mask_dir) \
+ do { \
+ x86_reg b_idx; \
+ mask_mv <<= 3; \
+ for( b_idx=0; b_idx<edges; b_idx+=step ) { \
+ if (!mask_dir) \
+ __asm__ volatile( \
+ "pxor %%mm0, %%mm0 \n\t" \
+ :: \
+ ); \
+ if(!(mask_mv & b_idx)) { \
+ if(bidir) { \
+ __asm__ volatile( \
+ "movd %a3(%0,%2), %%mm2 \n" \
+ "punpckldq %a4(%0,%2), %%mm2 \n" /* { ref0[bn], ref1[bn] } */ \
+ "pshufw $0x44, 12(%0,%2), %%mm0 \n" /* { ref0[b], ref0[b] } */ \
+ "pshufw $0x44, 52(%0,%2), %%mm1 \n" /* { ref1[b], ref1[b] } */ \
+ "pshufw $0x4E, %%mm2, %%mm3 \n" \
+ "psubb %%mm2, %%mm0 \n" /* { ref0[b]!=ref0[bn], ref0[b]!=ref1[bn] } */ \
+ "psubb %%mm3, %%mm1 \n" /* { ref1[b]!=ref1[bn], ref1[b]!=ref0[bn] } */ \
+ \
+ "por %%mm1, %%mm0 \n" \
+ "movq %a5(%1,%2,4), %%mm1 \n" \
+ "movq %a6(%1,%2,4), %%mm2 \n" \
+ "movq %%mm1, %%mm3 \n" \
+ "movq %%mm2, %%mm4 \n" \
+ "psubw 48(%1,%2,4), %%mm1 \n" \
+ "psubw 56(%1,%2,4), %%mm2 \n" \
+ "psubw 208(%1,%2,4), %%mm3 \n" \
+ "psubw 216(%1,%2,4), %%mm4 \n" \
+ "packsswb %%mm2, %%mm1 \n" \
+ "packsswb %%mm4, %%mm3 \n" \
+ "paddb %%mm6, %%mm1 \n" \
+ "paddb %%mm6, %%mm3 \n" \
+ "psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \
+ "psubusb %%mm5, %%mm3 \n" \
+ "packsswb %%mm3, %%mm1 \n" \
+ \
+ "por %%mm1, %%mm0 \n" \
+ "movq %a7(%1,%2,4), %%mm1 \n" \
+ "movq %a8(%1,%2,4), %%mm2 \n" \
+ "movq %%mm1, %%mm3 \n" \
+ "movq %%mm2, %%mm4 \n" \
+ "psubw 48(%1,%2,4), %%mm1 \n" \
+ "psubw 56(%1,%2,4), %%mm2 \n" \
+ "psubw 208(%1,%2,4), %%mm3 \n" \
+ "psubw 216(%1,%2,4), %%mm4 \n" \
+ "packsswb %%mm2, %%mm1 \n" \
+ "packsswb %%mm4, %%mm3 \n" \
+ "paddb %%mm6, %%mm1 \n" \
+ "paddb %%mm6, %%mm3 \n" \
+ "psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \
+ "psubusb %%mm5, %%mm3 \n" \
+ "packsswb %%mm3, %%mm1 \n" \
+ \
+ "pshufw $0x4E, %%mm1, %%mm1 \n" \
+ "por %%mm1, %%mm0 \n" \
+ "pshufw $0x4E, %%mm0, %%mm1 \n" \
+ "pminub %%mm1, %%mm0 \n" \
+ ::"r"(ref), \
+ "r"(mv), \
+ "r"(b_idx), \
+ "i"(d_idx+12), \
+ "i"(d_idx+52), \
+ "i"(d_idx*4+48), \
+ "i"(d_idx*4+56), \
+ "i"(d_idx*4+208), \
+ "i"(d_idx*4+216) \
+ ); \
+ } else { \
+ __asm__ volatile( \
+ "movd 12(%0,%2), %%mm0 \n" \
+ "psubb %a3(%0,%2), %%mm0 \n" /* ref[b] != ref[bn] */ \
+ "movq 48(%1,%2,4), %%mm1 \n" \
+ "movq 56(%1,%2,4), %%mm2 \n" \
+ "psubw %a4(%1,%2,4), %%mm1 \n" \
+ "psubw %a5(%1,%2,4), %%mm2 \n" \
+ "packsswb %%mm2, %%mm1 \n" \
+ "paddb %%mm6, %%mm1 \n" \
+ "psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \
+ "packsswb %%mm1, %%mm1 \n" \
+ "por %%mm1, %%mm0 \n" \
+ ::"r"(ref), \
+ "r"(mv), \
+ "r"(b_idx), \
+ "i"(d_idx+12), \
+ "i"(d_idx*4+48), \
+ "i"(d_idx*4+56) \
+ ); \
+ } \
+ } \
+ __asm__ volatile( \
+ "movd 12(%0,%1), %%mm1 \n" \
+ "por %a2(%0,%1), %%mm1 \n" /* nnz[b] || nnz[bn] */ \
+ ::"r"(nnz), \
+ "r"(b_idx), \
+ "i"(d_idx+12) \
+ ); \
+ __asm__ volatile( \
+ "pminub %%mm7, %%mm1 \n" \
+ "pminub %%mm7, %%mm0 \n" \
+ "psllw $1, %%mm1 \n" \
+ "pxor %%mm2, %%mm2 \n" \
+ "pmaxub %%mm0, %%mm1 \n" \
+ "punpcklbw %%mm2, %%mm1 \n" \
+ "movq %%mm1, %a1(%0,%2) \n" \
+ ::"r"(bS), \
+ "i"(32*dir), \
+ "r"(b_idx) \
+ :"memory" \
+ ); \
+ } \
+ } while (0)
+
static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2],
int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field ) {
- int dir;
__asm__ volatile(
"movq %0, %%mm7 \n"
"movq %1, %%mm6 \n"
@@ -84,95 +196,11 @@ static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40]
// could do a special case for dir==0 && edges==1, but it only reduces the
// average filter time by 1.2%
- for( dir=1; dir>=0; dir-- ) {
- const x86_reg d_idx = dir ? -8 : -1;
- const int mask_mv = dir ? mask_mv1 : mask_mv0;
- DECLARE_ALIGNED(8, const uint64_t, mask_dir) = dir ? 0 : 0xffffffffffffffffULL;
- int b_idx, edge;
- for( b_idx=12, edge=0; edge<edges; edge+=step, b_idx+=8*step ) {
- __asm__ volatile(
- "pand %0, %%mm0 \n\t"
- ::"m"(mask_dir)
- );
- if(!(mask_mv & edge)) {
- if(bidir) {
- __asm__ volatile(
- "movd (%1,%0), %%mm2 \n"
- "punpckldq 40(%1,%0), %%mm2 \n" // { ref0[bn], ref1[bn] }
- "pshufw $0x44, (%1), %%mm0 \n" // { ref0[b], ref0[b] }
- "pshufw $0x44, 40(%1), %%mm1 \n" // { ref1[b], ref1[b] }
- "pshufw $0x4E, %%mm2, %%mm3 \n"
- "psubb %%mm2, %%mm0 \n" // { ref0[b]!=ref0[bn], ref0[b]!=ref1[bn] }
- "psubb %%mm3, %%mm1 \n" // { ref1[b]!=ref1[bn], ref1[b]!=ref0[bn] }
- "1: \n"
- "por %%mm1, %%mm0 \n"
- "movq (%2,%0,4), %%mm1 \n"
- "movq 8(%2,%0,4), %%mm2 \n"
- "movq %%mm1, %%mm3 \n"
- "movq %%mm2, %%mm4 \n"
- "psubw (%2), %%mm1 \n"
- "psubw 8(%2), %%mm2 \n"
- "psubw 160(%2), %%mm3 \n"
- "psubw 168(%2), %%mm4 \n"
- "packsswb %%mm2, %%mm1 \n"
- "packsswb %%mm4, %%mm3 \n"
- "paddb %%mm6, %%mm1 \n"
- "paddb %%mm6, %%mm3 \n"
- "psubusb %%mm5, %%mm1 \n" // abs(mv[b] - mv[bn]) >= limit
- "psubusb %%mm5, %%mm3 \n"
- "packsswb %%mm3, %%mm1 \n"
- "add $40, %0 \n"
- "cmp $40, %0 \n"
- "jl 1b \n"
- "sub $80, %0 \n"
- "pshufw $0x4E, %%mm1, %%mm1 \n"
- "por %%mm1, %%mm0 \n"
- "pshufw $0x4E, %%mm0, %%mm1 \n"
- "pminub %%mm1, %%mm0 \n"
- ::"r"(d_idx),
- "r"(ref[0]+b_idx),
- "r"(mv[0]+b_idx)
- );
- } else {
- __asm__ volatile(
- "movd (%1), %%mm0 \n"
- "psubb (%1,%0), %%mm0 \n" // ref[b] != ref[bn]
- "movq (%2), %%mm1 \n"
- "movq 8(%2), %%mm2 \n"
- "psubw (%2,%0,4), %%mm1 \n"
- "psubw 8(%2,%0,4), %%mm2 \n"
- "packsswb %%mm2, %%mm1 \n"
- "paddb %%mm6, %%mm1 \n"
- "psubusb %%mm5, %%mm1 \n" // abs(mv[b] - mv[bn]) >= limit
- "packsswb %%mm1, %%mm1 \n"
- "por %%mm1, %%mm0 \n"
- ::"r"(d_idx),
- "r"(ref[0]+b_idx),
- "r"(mv[0]+b_idx)
- );
- }
- }
- __asm__ volatile(
- "movd %0, %%mm1 \n"
- "por %1, %%mm1 \n" // nnz[b] || nnz[bn]
- ::"m"(nnz[b_idx]),
- "m"(nnz[b_idx+d_idx])
- );
- __asm__ volatile(
- "pminub %%mm7, %%mm1 \n"
- "pminub %%mm7, %%mm0 \n"
- "psllw $1, %%mm1 \n"
- "pxor %%mm2, %%mm2 \n"
- "pmaxub %%mm0, %%mm1 \n"
- "punpcklbw %%mm2, %%mm1 \n"
- "movq %%mm1, %0 \n"
- :"=m"(*bS[dir][edge])
- ::"memory"
- );
- }
- edges = 4;
- step = 1;
- }
+ step <<= 3;
+ edges <<= 3;
+ h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, edges, step, mask_mv1, 1, -8, 0);
+ h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, 32, 8, mask_mv0, 0, -1, -1);
+
__asm__ volatile(
"movq (%0), %%mm0 \n\t"
"movq 8(%0), %%mm1 \n\t"
@@ -326,12 +354,13 @@ void ff_h264dsp_init_x86(H264DSPContext *c)
c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_sse2;
c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_sse2;
-#if ARCH_X86_64 || !defined(__ICC) || __ICC > 1110
+#if HAVE_ALIGNED_STACK
c->h264_v_loop_filter_luma = ff_x264_deblock_v_luma_sse2;
c->h264_h_loop_filter_luma = ff_x264_deblock_h_luma_sse2;
c->h264_v_loop_filter_luma_intra = ff_x264_deblock_v_luma_intra_sse2;
c->h264_h_loop_filter_luma_intra = ff_x264_deblock_h_luma_intra_sse2;
#endif
+
c->h264_idct_add16 = ff_h264_idct_add16_sse2;
c->h264_idct_add8 = ff_h264_idct_add8_sse2;
c->h264_idct_add16intra = ff_h264_idct_add16intra_sse2;
diff --git a/src/thirdparty/MediaInfo/Multiple/File_MpegPs.cpp b/src/thirdparty/MediaInfo/Multiple/File_MpegPs.cpp
index 17ad090f6..2540fa669 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_MpegPs.cpp
+++ b/src/thirdparty/MediaInfo/Multiple/File_MpegPs.cpp
@@ -2646,8 +2646,8 @@ void File_MpegPs::video_stream()
//Demux
#if MEDIAINFO_DEMUX
- if (!(FromTS_stream_type==0x20 && SubStream_Demux))
- Demux(Buffer+Buffer_Offset, (size_t)Element_Size, ContentType_MainStream);
+ if (!(FromTS_stream_type==0x20 && SubStream_Demux))
+ Demux(Buffer+Buffer_Offset, (size_t)Element_Size, ContentType_MainStream);
#endif //MEDIAINFO_DEMUX
//Parsing
@@ -2730,62 +2730,66 @@ void File_MpegPs::SL_packetized_stream()
}
//Parsing
- if (SLConfig) //LATM
- {
- BS_Begin();
- int8u paddingBits=0;
- bool paddingFlag=false, idleFlag=false/*not in spec*/, DegPrioflag=false/*not ins specs*/, OCRflag=false,
- accessUnitStartFlag=false/*should be "previous-SL packet has accessUnitEndFlag"*/, accessUnitEndFlag=false/*Should be "subsequent-SL packet has accessUnitStartFlag"*/,
- decodingTimeStampFlag=false/*not in spec*/, compositionTimeStampFlag=false/*not in spec*/,
- instantBitrateFlag=false/*not in spec*/;
- if (SLConfig->useAccessUnitStartFlag)
- Get_SB (accessUnitStartFlag, "accessUnitStartFlag");
- if (SLConfig->useAccessUnitEndFlag)
- Get_SB (accessUnitEndFlag, "accessUnitEndFlag");
- if (SLConfig->OCRLength>0)
- Get_SB (OCRflag, "OCRflag");
- if (SLConfig->useIdleFlag)
- Get_SB (idleFlag, "idleFlag");
- if (SLConfig->usePaddingFlag)
- Get_SB (paddingFlag, "paddingFlag");
- if (paddingFlag)
- Get_S1(3, paddingBits, "paddingBits");
- if (!idleFlag && (!paddingFlag || paddingBits!=0))
- {
- if (SLConfig->packetSeqNumLength>0)
- Skip_S2(SLConfig->packetSeqNumLength, "packetSequenceNumber");
- if (SLConfig->degradationPriorityLength>0)
- Get_SB (DegPrioflag, "DegPrioflag");
- if (DegPrioflag)
- Skip_S2(SLConfig->degradationPriorityLength, "degradationPriority");
- if (OCRflag)
- Skip_S8(SLConfig->OCRLength, "objectClockReference");
- if (accessUnitStartFlag)
+ #ifdef MEDIAINFO_MPEG4_YES
+ if (SLConfig) //LATM
+ {
+ BS_Begin();
+ int8u paddingBits=0;
+ bool paddingFlag=false, idleFlag=false/*not in spec*/, DegPrioflag=false/*not ins specs*/, OCRflag=false,
+ accessUnitStartFlag=false/*should be "previous-SL packet has accessUnitEndFlag"*/, accessUnitEndFlag=false/*Should be "subsequent-SL packet has accessUnitStartFlag"*/,
+ decodingTimeStampFlag=false/*not in spec*/, compositionTimeStampFlag=false/*not in spec*/,
+ instantBitrateFlag=false/*not in spec*/;
+ if (SLConfig->useAccessUnitStartFlag)
+ Get_SB (accessUnitStartFlag, "accessUnitStartFlag");
+ if (SLConfig->useAccessUnitEndFlag)
+ Get_SB (accessUnitEndFlag, "accessUnitEndFlag");
+ if (SLConfig->OCRLength>0)
+ Get_SB (OCRflag, "OCRflag");
+ if (SLConfig->useIdleFlag)
+ Get_SB (idleFlag, "idleFlag");
+ if (SLConfig->usePaddingFlag)
+ Get_SB (paddingFlag, "paddingFlag");
+ if (paddingFlag)
+ Get_S1(3, paddingBits, "paddingBits");
+ if (!idleFlag && (!paddingFlag || paddingBits!=0))
{
- if (SLConfig->useRandomAccessPointFlag)
- Skip_SB( "randomAccessPointFlag");
- if (SLConfig->AU_seqNumLength >0)
- Skip_S2(SLConfig->AU_seqNumLength, "AU_sequenceNumber");
- if (SLConfig->useTimeStampsFlag)
+ if (SLConfig->packetSeqNumLength>0)
+ Skip_S2(SLConfig->packetSeqNumLength, "packetSequenceNumber");
+ if (SLConfig->degradationPriorityLength>0)
+ Get_SB (DegPrioflag, "DegPrioflag");
+ if (DegPrioflag)
+ Skip_S2(SLConfig->degradationPriorityLength, "degradationPriority");
+ if (OCRflag)
+ Skip_S8(SLConfig->OCRLength, "objectClockReference");
+ if (accessUnitStartFlag)
{
- Get_SB (decodingTimeStampFlag, "decodingTimeStampFlag");
- Get_SB (compositionTimeStampFlag, "compositionTimeStampFlag");
+ if (SLConfig->useRandomAccessPointFlag)
+ Skip_SB( "randomAccessPointFlag");
+ if (SLConfig->AU_seqNumLength >0)
+ Skip_S2(SLConfig->AU_seqNumLength, "AU_sequenceNumber");
+ if (SLConfig->useTimeStampsFlag)
+ {
+ Get_SB (decodingTimeStampFlag, "decodingTimeStampFlag");
+ Get_SB (compositionTimeStampFlag, "compositionTimeStampFlag");
+ }
+ if (SLConfig->instantBitrateLength>0)
+ Get_SB (instantBitrateFlag, "instantBitrateFlag");
+ if (decodingTimeStampFlag)
+ Skip_S2(SLConfig->timeStampLength, "decodingTimeStamp");
+ if (compositionTimeStampFlag)
+ Skip_S2(SLConfig->timeStampLength, "compositionTimeStamp");
+ if (SLConfig->AU_Length > 0)
+ Skip_S2(SLConfig->AU_Length, "accessUnitLength");
+ if (instantBitrateFlag)
+ Skip_S2(SLConfig->instantBitrateLength, "instantBitrate");
}
- if (SLConfig->instantBitrateLength>0)
- Get_SB (instantBitrateFlag, "instantBitrateFlag");
- if (decodingTimeStampFlag)
- Skip_S2(SLConfig->timeStampLength, "decodingTimeStamp");
- if (compositionTimeStampFlag)
- Skip_S2(SLConfig->timeStampLength, "compositionTimeStamp");
- if (SLConfig->AU_Length > 0)
- Skip_S2(SLConfig->AU_Length, "accessUnitLength");
- if (instantBitrateFlag)
- Skip_S2(SLConfig->instantBitrateLength, "instantBitrate");
}
+ BS_End();
+ Skip_XX(Element_Size-Element_Offset, "AAC (raw)");
}
- BS_End();
- Skip_XX(Element_Size-Element_Offset, "AAC (raw)");
- }
+ #else //MEDIAINFO_MPEG4_YES
+ Skip_XX(Element_Size, "LATM (not decoded)");
+ #endif //MEDIAINFO_MPEG4_YES
//Demux
if (MediaInfoLib::Config.Demux_Get())
diff --git a/src/thirdparty/MediaInfo/Multiple/File_MpegTs.cpp b/src/thirdparty/MediaInfo/Multiple/File_MpegTs.cpp
index b37ee462d..dbbf25dec 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_MpegTs.cpp
+++ b/src/thirdparty/MediaInfo/Multiple/File_MpegTs.cpp
@@ -268,8 +268,8 @@ void File_MpegTs::Streams_Fill()
}
else
StreamPos_Last=Program->second.StreamPos;
- Fill(Stream_Menu, StreamPos_Last, Menu_ID, Program->second.pid);
- Fill(Stream_Menu, StreamPos_Last, Menu_ID_String, Decimal_Hexa(Program->second.pid), true);
+ Fill(Stream_Menu, StreamPos_Last, Menu_ID, Program->second.PID);
+ Fill(Stream_Menu, StreamPos_Last, Menu_ID_String, Decimal_Hexa(Program->second.PID), true);
Fill(Stream_Menu, StreamPos_Last, Menu_MenuID, Program->first);
Fill(Stream_Menu, StreamPos_Last, Menu_MenuID_String, Decimal_Hexa(Program->first));
for (std::map<std::string, ZenLib::Ztring>::iterator Info=Program->second.Infos.begin(); Info!=Program->second.Infos.end(); Info++)
@@ -322,8 +322,8 @@ void File_MpegTs::Streams_Fill()
if (Complete_Stream->Duration_End_IsUpdated)
PSI_Duration_End_Update();
#ifdef MEDIAINFO_MPEGTS_PCR_YES
- for (pid=0; pid<0x2000; pid++)
- if (Complete_Stream->Streams[pid].IsPCR && Complete_Stream->Streams[pid].TimeStamp_End!=(int64u)-1)
+ for (PID=0; PID<0x2000; PID++)
+ if (Complete_Stream->Streams[PID].IsPCR && Complete_Stream->Streams[PID].TimeStamp_End!=(int64u)-1)
Header_Parse_AdaptationField_Duration_Update();
#endif //MEDIAINFO_MPEGTS_PCR_YES
}
@@ -481,6 +481,17 @@ void File_MpegTs::Streams_Fill_PerStream(int16u PID, complete_stream::stream &Te
}
}
+ //Commercial name
+ if (Count_Get(Stream_Video)==1
+ && Count_Get(Stream_Audio)==1
+ && Retrieve(Stream_Video, 0, Video_Format)==_T("MPEG Video")
+ && Retrieve(Stream_Video, 0, Video_Format_Commercial_IfAny).find(_T("HDV"))==0
+ && Retrieve(Stream_Audio, 0, Audio_Format)==_T("MPEG Audio")
+ && Retrieve(Stream_Audio, 0, Audio_Format_Version)==_T("Version 1")
+ && Retrieve(Stream_Audio, 0, Audio_Format_Profile)==_T("Layer 2")
+ && Retrieve(Stream_Audio, 0, Audio_BitRate)==_T("384000"))
+ Fill(Stream_General, 0, Video_Format_Commercial_IfAny, Retrieve(Stream_Video, 0, Video_Format_Commercial_IfAny));
+
//Desactivating the stream (except for timestamp)
Temp.Searching_Payload_Start_Set(false);
Temp.Searching_Payload_Continue_Set(false);
@@ -670,10 +681,10 @@ bool File_MpegTs::Synched_Test()
}
//Getting PID
- pid=(Buffer[Buffer_Offset+BDAV_Size+1]&0x1F)<<8
+ PID=(Buffer[Buffer_Offset+BDAV_Size+1]&0x1F)<<8
| Buffer[Buffer_Offset+BDAV_Size+2];
- complete_stream::streams::iterator Stream=Complete_Stream->Streams.begin()+pid;
+ complete_stream::streams::iterator Stream=Complete_Stream->Streams.begin()+PID;
if (Stream->Searching)
{
payload_unit_start_indicator=(Buffer[Buffer_Offset+BDAV_Size+1]&0x40)!=0;
@@ -738,7 +749,7 @@ bool File_MpegTs::Synched_Test()
}
}
else
- return true; //No version in this pid
+ return true; //No version in this PID
}
}
@@ -775,39 +786,39 @@ bool File_MpegTs::Synched_Test()
program_clock_reference*=300;
program_clock_reference+=( (((int64u)Buffer[Buffer_Offset+BDAV_Size+10]&0x01)<<8)
| (((int64u)Buffer[Buffer_Offset+BDAV_Size+11]) ));
- if (Complete_Stream->Streams[pid].Searching_TimeStamp_End
+ if (Complete_Stream->Streams[PID].Searching_TimeStamp_End
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- && (!Complete_Stream->Streams[pid].Searching_ParserTimeStamp_End
- || Complete_Stream->Streams[pid].IsPCR) //If PCR, we always want it.
+ && (!Complete_Stream->Streams[PID].Searching_ParserTimeStamp_End
+ || Complete_Stream->Streams[PID].IsPCR) //If PCR, we always want it.
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
)
{
Header_Parse_Events_Duration(program_clock_reference);
- Complete_Stream->Streams[pid].TimeStamp_End=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].TimeStamp_End=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
if (Status[IsFilled])
Header_Parse_AdaptationField_Duration_Update();
}
- if (Complete_Stream->Streams[pid].Searching_TimeStamp_Start)
+ if (Complete_Stream->Streams[PID].Searching_TimeStamp_Start)
{
//This is the first PCR
- Complete_Stream->Streams[pid].TimeStamp_Start=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_Start_Offset=File_Offset+Buffer_Offset;
- Complete_Stream->Streams[pid].TimeStamp_End=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
- Complete_Stream->Streams[pid].Searching_TimeStamp_Start_Set(false);
- Complete_Stream->Streams[pid].Searching_TimeStamp_End_Set(true);
+ Complete_Stream->Streams[PID].TimeStamp_Start=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_Start_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].TimeStamp_End=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].Searching_TimeStamp_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_TimeStamp_End_Set(true);
Complete_Stream->Streams_With_StartTimeStampCount++;
}
//Test if we can find the TS bitrate
- if (!Complete_Stream->Streams[pid].EndTimeStampMoreThanxSeconds && Complete_Stream->Streams[pid].TimeStamp_Start!=(int64u)-1)
+ if (!Complete_Stream->Streams[PID].EndTimeStampMoreThanxSeconds && Complete_Stream->Streams[PID].TimeStamp_Start!=(int64u)-1)
{
- if (program_clock_reference<Complete_Stream->Streams[pid].TimeStamp_Start)
+ if (program_clock_reference<Complete_Stream->Streams[PID].TimeStamp_Start)
program_clock_reference+=0x200000000LL*300; //33 bits, cyclic
- if ((program_clock_reference-Complete_Stream->Streams[pid].TimeStamp_Start)/27000>8000)
+ if ((program_clock_reference-Complete_Stream->Streams[PID].TimeStamp_Start)/27000>8000)
{
- Complete_Stream->Streams[pid].EndTimeStampMoreThanxSeconds=true;
+ Complete_Stream->Streams[PID].EndTimeStampMoreThanxSeconds=true;
Complete_Stream->Streams_With_EndTimeStampMoreThanxSecondsCount++;
if (Complete_Stream->Streams_NotParsedCount==0
&& Complete_Stream->Streams_With_StartTimeStampCount>0
@@ -830,7 +841,7 @@ bool File_MpegTs::Synched_Test()
if (Stream->ShouldDuplicate)
{
Element_Size=TS_Size;
- File__Duplicate_Write(pid);
+ File__Duplicate_Write(PID);
}
Header_Parse_Events();
@@ -960,7 +971,7 @@ void File_MpegTs::Header_Parse()
Skip_SB( "transport_error_indicator");
Get_SB ( payload_unit_start_indicator, "payload_unit_start_indicator");
Skip_SB( "transport_priority");
- Get_S2 (13, pid, "pid");
+ Get_S2 (13, PID, "PID");
Get_S1 ( 2, transport_scrambling_control, "transport_scrambling_control");
Get_SB ( adaptation, "adaptation_field_control (adaptation)");
Get_SB ( payload, "adaptation_field_control (payload)");
@@ -968,18 +979,18 @@ void File_MpegTs::Header_Parse()
BS_End();
//Info
- if (!Complete_Stream->Streams[pid].program_numbers.empty())
+ if (!Complete_Stream->Streams[PID].program_numbers.empty())
{
Ztring Program_Numbers;
- for (size_t Pos=0; Pos<Complete_Stream->Streams[pid].program_numbers.size(); Pos++)
- Program_Numbers+=Ztring::ToZtring_From_CC2(Complete_Stream->Streams[pid].program_numbers[Pos])+_T('/');
+ for (size_t Pos=0; Pos<Complete_Stream->Streams[PID].program_numbers.size(); Pos++)
+ Program_Numbers+=Ztring::ToZtring_From_CC2(Complete_Stream->Streams[PID].program_numbers[Pos])+_T('/');
if (!Program_Numbers.empty())
Program_Numbers.resize(Program_Numbers.size()-1);
Data_Info(Program_Numbers);
}
else
Data_Info(" ");
- Data_Info(Complete_Stream->Streams[pid].Element_Info);
+ Data_Info(Complete_Stream->Streams[PID].Element_Info);
//Adaptation
if (adaptation)
@@ -990,13 +1001,13 @@ void File_MpegTs::Header_Parse()
{
//Encryption
if (transport_scrambling_control>0)
- Complete_Stream->Streams[pid].IsScrambled++;
+ Complete_Stream->Streams[PID].IsScrambled++;
}
else if (Element_Offset<TS_Size)
Skip_XX(TS_Size-Element_Offset, "Junk");
//Filling
- Header_Fill_Code(pid, Ztring().From_CC2(pid));
+ Header_Fill_Code(PID, Ztring().From_CC2(PID));
Header_Fill_Size(TS_Size);
Header_Parse_Events();
@@ -1019,7 +1030,7 @@ void File_MpegTs::Header_Parse()
{
//Encryption
if (transport_scrambling_control>0)
- Complete_Stream->Streams[pid].IsScrambled++;
+ Complete_Stream->Streams[PID].IsScrambled++;
}
//Filling
@@ -1069,39 +1080,39 @@ void File_MpegTs::Header_Parse_AdaptationField()
int64u program_clock_reference=program_clock_reference_base*300+program_clock_reference_extension;
Param_Info(program_clock_reference);
BS_End();
- if (Complete_Stream->Streams[pid].Searching_TimeStamp_End
+ if (Complete_Stream->Streams[PID].Searching_TimeStamp_End
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- && (!Complete_Stream->Streams[pid].Searching_ParserTimeStamp_End
- || Complete_Stream->Streams[pid].IsPCR) //If PCR, we always want it.
+ && (!Complete_Stream->Streams[PID].Searching_ParserTimeStamp_End
+ || Complete_Stream->Streams[PID].IsPCR) //If PCR, we always want it.
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
)
{
Header_Parse_Events_Duration(program_clock_reference);
- Complete_Stream->Streams[pid].TimeStamp_End=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].TimeStamp_End=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
if (Status[IsFilled])
Header_Parse_AdaptationField_Duration_Update();
}
- if (Complete_Stream->Streams[pid].Searching_TimeStamp_Start)
+ if (Complete_Stream->Streams[PID].Searching_TimeStamp_Start)
{
//This is the first PCR
- Complete_Stream->Streams[pid].TimeStamp_Start=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_Start_Offset=File_Offset+Buffer_Offset;
- Complete_Stream->Streams[pid].TimeStamp_End=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
- Complete_Stream->Streams[pid].Searching_TimeStamp_Start_Set(false);
- Complete_Stream->Streams[pid].Searching_TimeStamp_End_Set(true);
+ Complete_Stream->Streams[PID].TimeStamp_Start=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_Start_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].TimeStamp_End=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].Searching_TimeStamp_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_TimeStamp_End_Set(true);
Complete_Stream->Streams_With_StartTimeStampCount++;
}
//Test if we can find the TS bitrate
- if (!Complete_Stream->Streams[pid].EndTimeStampMoreThanxSeconds && Complete_Stream->Streams[pid].TimeStamp_Start!=(int64u)-1)
+ if (!Complete_Stream->Streams[PID].EndTimeStampMoreThanxSeconds && Complete_Stream->Streams[PID].TimeStamp_Start!=(int64u)-1)
{
- if (program_clock_reference<Complete_Stream->Streams[pid].TimeStamp_Start)
+ if (program_clock_reference<Complete_Stream->Streams[PID].TimeStamp_Start)
program_clock_reference+=0x200000000LL*300; //33 bits, cyclic
- if ((program_clock_reference-Complete_Stream->Streams[pid].TimeStamp_Start)/27000>8000)
+ if ((program_clock_reference-Complete_Stream->Streams[PID].TimeStamp_Start)/27000>8000)
{
- Complete_Stream->Streams[pid].EndTimeStampMoreThanxSeconds=true;
+ Complete_Stream->Streams[PID].EndTimeStampMoreThanxSeconds=true;
Complete_Stream->Streams_With_EndTimeStampMoreThanxSecondsCount++;
if (Complete_Stream->Streams_NotParsedCount==0
&& Complete_Stream->Streams_With_StartTimeStampCount>0
@@ -1216,39 +1227,39 @@ void File_MpegTs::Header_Parse_AdaptationField()
program_clock_reference*=300;
program_clock_reference+=( (((int64u)Buffer[Buffer_Offset+BDAV_Size+10]&0x01)<<8)
| (((int64u)Buffer[Buffer_Offset+BDAV_Size+11]) ));
- if (Complete_Stream->Streams[pid].Searching_TimeStamp_End
+ if (Complete_Stream->Streams[PID].Searching_TimeStamp_End
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- && (!Complete_Stream->Streams[pid].Searching_ParserTimeStamp_End
- || Complete_Stream->Streams[pid].IsPCR) //If PCR, we always want it.
+ && (!Complete_Stream->Streams[PID].Searching_ParserTimeStamp_End
+ || Complete_Stream->Streams[PID].IsPCR) //If PCR, we always want it.
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
)
{
Header_Parse_Events_Duration(program_clock_reference);
- Complete_Stream->Streams[pid].TimeStamp_End=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].TimeStamp_End=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
if (Status[IsFilled])
Header_Parse_AdaptationField_Duration_Update();
}
- if (Complete_Stream->Streams[pid].Searching_TimeStamp_Start)
+ if (Complete_Stream->Streams[PID].Searching_TimeStamp_Start)
{
//This is the first PCR
- Complete_Stream->Streams[pid].TimeStamp_Start=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_Start_Offset=File_Offset+Buffer_Offset;
- Complete_Stream->Streams[pid].TimeStamp_End=program_clock_reference;
- Complete_Stream->Streams[pid].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
- Complete_Stream->Streams[pid].Searching_TimeStamp_Start_Set(false);
- Complete_Stream->Streams[pid].Searching_TimeStamp_End_Set(true);
+ Complete_Stream->Streams[PID].TimeStamp_Start=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_Start_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].TimeStamp_End=program_clock_reference;
+ Complete_Stream->Streams[PID].TimeStamp_End_Offset=File_Offset+Buffer_Offset;
+ Complete_Stream->Streams[PID].Searching_TimeStamp_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_TimeStamp_End_Set(true);
Complete_Stream->Streams_With_StartTimeStampCount++;
}
//Test if we can find the TS bitrate
- if (!Complete_Stream->Streams[pid].EndTimeStampMoreThanxSeconds && Complete_Stream->Streams[pid].TimeStamp_Start!=(int64u)-1)
+ if (!Complete_Stream->Streams[PID].EndTimeStampMoreThanxSeconds && Complete_Stream->Streams[PID].TimeStamp_Start!=(int64u)-1)
{
- if (program_clock_reference<Complete_Stream->Streams[pid].TimeStamp_Start)
+ if (program_clock_reference<Complete_Stream->Streams[PID].TimeStamp_Start)
program_clock_reference+=0x200000000LL*300; //33 bits, cyclic
- if ((program_clock_reference-Complete_Stream->Streams[pid].TimeStamp_Start)/27000>8000)
+ if ((program_clock_reference-Complete_Stream->Streams[PID].TimeStamp_Start)/27000>8000)
{
- Complete_Stream->Streams[pid].EndTimeStampMoreThanxSeconds=true;
+ Complete_Stream->Streams[PID].EndTimeStampMoreThanxSeconds=true;
Complete_Stream->Streams_With_EndTimeStampMoreThanxSecondsCount++;
if (Complete_Stream->Streams_NotParsedCount==0
&& Complete_Stream->Streams_With_StartTimeStampCount>0
@@ -1278,16 +1289,16 @@ void File_MpegTs::Header_Parse_Events()
#ifdef MEDIAINFO_MPEGTS_PCR_YES
void File_MpegTs::Header_Parse_AdaptationField_Duration_Update()
{
- if (Complete_Stream->Streams[pid].TimeStamp_End<0x100000000LL*300 && Complete_Stream->Streams[pid].TimeStamp_Start>0x100000000LL*300)
- Complete_Stream->Streams[pid].TimeStamp_End+=0x200000000LL*300; //33 bits, cyclic
- float64 Duration=((float64)((int64s)(Complete_Stream->Streams[pid].TimeStamp_End-Complete_Stream->Streams[pid].TimeStamp_Start)))/27000;
+ if (Complete_Stream->Streams[PID].TimeStamp_End<0x100000000LL*300 && Complete_Stream->Streams[PID].TimeStamp_Start>0x100000000LL*300)
+ Complete_Stream->Streams[PID].TimeStamp_End+=0x200000000LL*300; //33 bits, cyclic
+ float64 Duration=((float64)((int64s)(Complete_Stream->Streams[PID].TimeStamp_End-Complete_Stream->Streams[PID].TimeStamp_Start)))/27000;
float64 Duration_Current=Retrieve(Stream_General, 0, General_Duration).To_float64();
if (Retrieve(Stream_General, 0, General_Duration).empty() || Duration>Duration_Current || Duration+700<Duration_Current) //If superior or too different
Fill(Stream_General, 0, General_Duration, Duration, 6, true); //Only if greater than the current duration
//TODO: I have small but annoying memory leaks with this version (on big files and Full parsing)
- //Fill(Stream_General, 0, General_OverallBitRate, (Complete_Stream->Streams[pid].TimeStamp_End_Offset-Complete_Stream->Streams[pid].TimeStamp_Start_Offset)*8*1000/Duration, 0, true);
+ //Fill(Stream_General, 0, General_OverallBitRate, (Complete_Stream->Streams[PID].TimeStamp_End_Offset-Complete_Stream->Streams[PID].TimeStamp_Start_Offset)*8*1000/Duration, 0, true);
//Filling menu duration
if (Count_Get(Stream_Menu))
@@ -1296,9 +1307,9 @@ void File_MpegTs::Header_Parse_AdaptationField_Duration_Update()
if (Transport_Stream!=Complete_Stream->Transport_Streams.end())
{
//Per program
- for (size_t Pos=0; Pos<Complete_Stream->Streams[pid].program_numbers.size(); Pos++)
+ for (size_t Pos=0; Pos<Complete_Stream->Streams[PID].program_numbers.size(); Pos++)
{
- int16u program_number=Complete_Stream->Streams[pid].program_numbers[Pos];
+ int16u program_number=Complete_Stream->Streams[PID].program_numbers[Pos];
if (Transport_Stream->second.Programs[program_number].IsParsed)
Fill(Stream_Menu, Transport_Stream->second.Programs[program_number].StreamPos, Menu_Duration, Duration, 6, true);
}
@@ -1328,20 +1339,20 @@ void File_MpegTs::Data_Parse()
Element_Size-=TSP_Size;
//File__Duplicate
- if (Complete_Stream->Streams[pid].ShouldDuplicate)
- File__Duplicate_Write(pid);
+ if (Complete_Stream->Streams[PID].ShouldDuplicate)
+ File__Duplicate_Write(PID);
//Parsing
- if (!Complete_Stream->Streams[pid].Searching_Payload_Start
- && !Complete_Stream->Streams[pid].Searching_Payload_Continue
+ if (!Complete_Stream->Streams[PID].Searching_Payload_Start
+ && !Complete_Stream->Streams[PID].Searching_Payload_Continue
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- && !Complete_Stream->Streams[pid].Searching_ParserTimeStamp_Start
- && !Complete_Stream->Streams[pid].Searching_ParserTimeStamp_End
+ && !Complete_Stream->Streams[PID].Searching_ParserTimeStamp_Start
+ && !Complete_Stream->Streams[PID].Searching_ParserTimeStamp_End
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
)
Skip_XX(Element_Size, "data");
else
- switch (Complete_Stream->Streams[pid].Kind)
+ switch (Complete_Stream->Streams[PID].Kind)
{
case complete_stream::stream::pes : PES(); break;
case complete_stream::stream::psi : PSI(); break;
@@ -1364,35 +1375,35 @@ void File_MpegTs::Data_Parse()
void File_MpegTs::PES()
{
//Info
- DETAILS_INFO(if (Complete_Stream->transport_stream_id_IsValid) Element_Info(Mpeg_Psi_stream_type_Info(Complete_Stream->Streams[pid].stream_type, Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[pid].program_numbers[0]].registration_format_identifier));)
+ DETAILS_INFO(if (Complete_Stream->transport_stream_id_IsValid) Element_Info(Mpeg_Psi_stream_type_Info(Complete_Stream->Streams[PID].stream_type, Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[PID].program_numbers[0]].registration_format_identifier));)
//Demux
#if MEDIAINFO_DEMUX
- Element_Code=pid;
+ Element_Code=PID;
Demux(Buffer+Buffer_Offset, (size_t)Element_Size, ContentType_MainStream);
#endif //MEDIAINFO_DEMUX
//Exists
- if (!Complete_Stream->Streams[pid].IsRegistered)
+ if (!Complete_Stream->Streams[PID].IsRegistered)
{
- Complete_Stream->Streams[pid].IsRegistered=true;
- for (size_t Pos=0; Pos<Complete_Stream->Streams[pid].program_numbers.size(); Pos++)
- Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[pid].program_numbers[Pos]].IsRegistered=true;
+ Complete_Stream->Streams[PID].IsRegistered=true;
+ for (size_t Pos=0; Pos<Complete_Stream->Streams[PID].program_numbers.size(); Pos++)
+ Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[PID].program_numbers[Pos]].IsRegistered=true;
}
//Case of encrypted streams
- if (Complete_Stream->Streams[pid].IsScrambled)
+ if (Complete_Stream->Streams[PID].IsScrambled)
{
- if (!Complete_Stream->Streams[pid].Searching_Payload_Continue)
- Complete_Stream->Streams[pid].Searching_Payload_Continue_Set(true); //In order to count the packets
+ if (!Complete_Stream->Streams[PID].Searching_Payload_Continue)
+ Complete_Stream->Streams[PID].Searching_Payload_Continue_Set(true); //In order to count the packets
- if (Complete_Stream->Streams[pid].IsScrambled>16)
+ if (Complete_Stream->Streams[PID].IsScrambled>16)
{
//Don't need anymore
- Complete_Stream->Streams[pid].Searching_Payload_Start_Set(false);
- Complete_Stream->Streams[pid].Searching_Payload_Continue_Set(false);
+ Complete_Stream->Streams[PID].Searching_Payload_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_Payload_Continue_Set(false);
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- Complete_Stream->Streams[pid].Searching_ParserTimeStamp_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_ParserTimeStamp_Start_Set(false);
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
}
Skip_XX(Element_Size-Element_Offset, "Scrambled data");
@@ -1401,7 +1412,7 @@ void File_MpegTs::PES()
}
//Parser creation
- if (Complete_Stream->Streams[pid].Parser==NULL)
+ if (Complete_Stream->Streams[PID].Parser==NULL)
{
//Waiting for first payload_unit_start_indicator
if (!payload_unit_start_indicator)
@@ -1412,17 +1423,17 @@ void File_MpegTs::PES()
//If unknown stream_type
if (Complete_Stream->transport_stream_id_IsValid
- && Mpeg_Psi_stream_type_StreamKind(Complete_Stream->Streams[pid].stream_type, Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[pid].program_numbers[0]].registration_format_identifier)==Stream_Max
- && Complete_Stream->Streams[pid].stream_type!=0x06 //Exception for private data
- && Complete_Stream->Streams[pid].stream_type<=0x7F //Exception for private data
- && Mpeg_Descriptors_registration_format_identifier_StreamKind(Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[pid].program_numbers[0]].registration_format_identifier)==Stream_Max //From Descriptor
+ && Mpeg_Psi_stream_type_StreamKind(Complete_Stream->Streams[PID].stream_type, Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[PID].program_numbers[0]].registration_format_identifier)==Stream_Max
+ && Complete_Stream->Streams[PID].stream_type!=0x06 //Exception for private data
+ && Complete_Stream->Streams[PID].stream_type<=0x7F //Exception for private data
+ && Mpeg_Descriptors_registration_format_identifier_StreamKind(Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[PID].program_numbers[0]].registration_format_identifier)==Stream_Max //From Descriptor
&& Config->File_MpegTs_stream_type_Trust_Get())
{
- Complete_Stream->Streams[pid].Searching_Payload_Start_Set(false);
- Complete_Stream->Streams[pid].Searching_Payload_Continue_Set(false);
+ Complete_Stream->Streams[PID].Searching_Payload_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_Payload_Continue_Set(false);
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- Complete_Stream->Streams[pid].Searching_ParserTimeStamp_Start_Set(false);
- Complete_Stream->Streams[pid].Searching_ParserTimeStamp_End_Set(false);
+ Complete_Stream->Streams[PID].Searching_ParserTimeStamp_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_ParserTimeStamp_End_Set(false);
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
Complete_Stream->Streams_NotParsedCount--;
return;
@@ -1430,92 +1441,92 @@ void File_MpegTs::PES()
//Allocating an handle if needed
#if defined(MEDIAINFO_MPEGPS_YES)
- Complete_Stream->Streams[pid].Parser=new File_MpegPs;
+ Complete_Stream->Streams[PID].Parser=new File_MpegPs;
#if MEDIAINFO_DEMUX
if (MediaInfoLib::Config.Demux_Get())
{
- if (Complete_Stream->Streams[pid].stream_type==0x20 && Complete_Stream->Streams[pid].SubStream_pid)
+ if (Complete_Stream->Streams[PID].stream_type==0x20 && Complete_Stream->Streams[PID].SubStream_pid)
{
//Creating the demux buffer
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->SubStream_Demux=new File_MpegPs::demux;
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->SubStream_Demux=new File_MpegPs::demux;
//If main parser is already created, associating the new demux buffer
- if (Complete_Stream->Streams[Complete_Stream->Streams[pid].SubStream_pid].Parser)
- ((File_MpegPs*)Complete_Stream->Streams[Complete_Stream->Streams[pid].SubStream_pid].Parser)->SubStream_Demux=((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->SubStream_Demux;
+ if (Complete_Stream->Streams[Complete_Stream->Streams[PID].SubStream_pid].Parser)
+ ((File_MpegPs*)Complete_Stream->Streams[Complete_Stream->Streams[PID].SubStream_pid].Parser)->SubStream_Demux=((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->SubStream_Demux;
}
- if (Complete_Stream->Streams[pid].stream_type!=0x20 && Complete_Stream->Streams[pid].SubStream_pid && (File_MpegPs*)Complete_Stream->Streams[Complete_Stream->Streams[pid].SubStream_pid].Parser)
+ if (Complete_Stream->Streams[PID].stream_type!=0x20 && Complete_Stream->Streams[PID].SubStream_pid && (File_MpegPs*)Complete_Stream->Streams[Complete_Stream->Streams[PID].SubStream_pid].Parser)
{
//If SubStream parser is already created, associating the SubStream demux buffer
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->SubStream_Demux=((File_MpegPs*)Complete_Stream->Streams[Complete_Stream->Streams[pid].SubStream_pid].Parser)->SubStream_Demux;
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->SubStream_Demux=((File_MpegPs*)Complete_Stream->Streams[Complete_Stream->Streams[PID].SubStream_pid].Parser)->SubStream_Demux;
}
}
#endif //MEDIAINFO_DEMUX
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
if (Searching_TimeStamp_Start)
- Complete_Stream->Streams[pid].Searching_ParserTimeStamp_Start_Set(true);
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->Searching_TimeStamp_Start=Complete_Stream->Streams[pid].Searching_ParserTimeStamp_Start;
+ Complete_Stream->Streams[PID].Searching_ParserTimeStamp_Start_Set(true);
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->Searching_TimeStamp_Start=Complete_Stream->Streams[PID].Searching_ParserTimeStamp_Start;
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->FromTS=true;
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->FromTS=true;
if (Config->File_MpegTs_stream_type_Trust_Get())
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->FromTS_stream_type=Complete_Stream->Streams[pid].stream_type;
- if (!Complete_Stream->Streams[pid].program_numbers.empty())
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->FromTS_program_format_identifier=Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[pid].program_numbers[0]].registration_format_identifier;
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->FromTS_format_identifier=Complete_Stream->Streams[pid].registration_format_identifier;
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->MPEG_Version=2;
- complete_stream::transport_stream::iod_ess::iterator IOD_ES=Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].IOD_ESs.find(Complete_Stream->Streams[pid].FMC_ES_ID);
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->FromTS_stream_type=Complete_Stream->Streams[PID].stream_type;
+ if (!Complete_Stream->Streams[PID].program_numbers.empty())
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->FromTS_program_format_identifier=Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[PID].program_numbers[0]].registration_format_identifier;
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->FromTS_format_identifier=Complete_Stream->Streams[PID].registration_format_identifier;
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->MPEG_Version=2;
+ complete_stream::transport_stream::iod_ess::iterator IOD_ES=Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].IOD_ESs.find(Complete_Stream->Streams[PID].FMC_ES_ID);
if (IOD_ES!=Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].IOD_ESs.end())
{
#ifdef FILE_MPEG4_YES
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->DecSpecificInfoTag=IOD_ES->second.DecSpecificInfoTag;
- ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->SLConfig=IOD_ES->second.SLConfig;
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->DecSpecificInfoTag=IOD_ES->second.DecSpecificInfoTag;
+ ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->SLConfig=IOD_ES->second.SLConfig;
#endif
}
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- Complete_Stream->Streams[pid].Parser->ShouldContinueParsing=true;
+ Complete_Stream->Streams[PID].Parser->ShouldContinueParsing=true;
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- Complete_Stream->Streams[pid].Searching_Payload_Continue_Set(true);
+ Complete_Stream->Streams[PID].Searching_Payload_Continue_Set(true);
#else
//Filling
- Streams[pid].Parser=new File_Unknown();
+ Streams[PID].Parser=new File_Unknown();
#endif
- Open_Buffer_Init(Complete_Stream->Streams[pid].Parser);
+ Open_Buffer_Init(Complete_Stream->Streams[PID].Parser);
}
//If unsynched, waiting for first payload_unit_start_indicator
- if (!Complete_Stream->Streams[pid].Parser->Synched && !payload_unit_start_indicator)
+ if (!Complete_Stream->Streams[PID].Parser->Synched && !payload_unit_start_indicator)
{
Element_DoNotShow(); //We don't want to show this item because there is no interessant info
return; //This is not the start of the PES
}
//Parsing
- Open_Buffer_Continue(Complete_Stream->Streams[pid].Parser);
+ Open_Buffer_Continue(Complete_Stream->Streams[PID].Parser);
#if defined(MEDIAINFO_MPEGPS_YES) && defined(MEDIAINFO_MPEGTS_PESTIMESTAMP_YES)
if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>File_Size
- && !Complete_Stream->Streams[pid].Searching_ParserTimeStamp_End
- && ((File_MpegPs*)Complete_Stream->Streams[pid].Parser)->HasTimeStamps)
+ && !Complete_Stream->Streams[PID].Searching_ParserTimeStamp_End
+ && ((File_MpegPs*)Complete_Stream->Streams[PID].Parser)->HasTimeStamps)
{
- Complete_Stream->Streams[pid].Searching_ParserTimeStamp_Start_Set(false);
- Complete_Stream->Streams[pid].Searching_ParserTimeStamp_End_Set(true);
+ Complete_Stream->Streams[PID].Searching_ParserTimeStamp_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_ParserTimeStamp_End_Set(true);
}
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
//Need anymore?
- if (Complete_Stream->Streams[pid].Parser->Status[IsFilled]
- || Complete_Stream->Streams[pid].Parser->Status[IsFinished])
+ if (Complete_Stream->Streams[PID].Parser->Status[IsFilled]
+ || Complete_Stream->Streams[PID].Parser->Status[IsFinished])
{
- if ((Complete_Stream->Streams[pid].Searching_Payload_Start || Complete_Stream->Streams[pid].Searching_Payload_Continue) && MediaInfoLib::Config.ParseSpeed_Get()<1)
+ if ((Complete_Stream->Streams[PID].Searching_Payload_Start || Complete_Stream->Streams[PID].Searching_Payload_Continue) && MediaInfoLib::Config.ParseSpeed_Get()<1)
{
- Complete_Stream->Streams[pid].Searching_Payload_Start_Set(false);
- Complete_Stream->Streams[pid].Searching_Payload_Continue_Set(false);
+ Complete_Stream->Streams[PID].Searching_Payload_Start_Set(false);
+ Complete_Stream->Streams[PID].Searching_Payload_Continue_Set(false);
if (Complete_Stream->Streams_NotParsedCount)
Complete_Stream->Streams_NotParsedCount--;
}
#ifdef MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
- if (Complete_Stream->Streams[pid].Searching_ParserTimeStamp_Start)
- Complete_Stream->Streams[pid].Searching_ParserTimeStamp_Start_Set(false);
+ if (Complete_Stream->Streams[PID].Searching_ParserTimeStamp_Start)
+ Complete_Stream->Streams[PID].Searching_ParserTimeStamp_Start_Set(false);
#else //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
if (MediaInfoLib::Config.ParseSpeed_Get()<1.0)
- Finish(Complete_Stream->Streams[pid].Parser);
+ Finish(Complete_Stream->Streams[PID].Parser);
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
}
}
@@ -1526,19 +1537,19 @@ void File_MpegTs::PSI()
//Initializing
if (payload_unit_start_indicator)
{
- delete ((File_Mpeg_Psi*)Complete_Stream->Streams[pid].Parser); Complete_Stream->Streams[pid].Parser=new File_Mpeg_Psi;
- Open_Buffer_Init(Complete_Stream->Streams[pid].Parser);
- ((File_Mpeg_Psi*)Complete_Stream->Streams[pid].Parser)->Complete_Stream=Complete_Stream;
- ((File_Mpeg_Psi*)Complete_Stream->Streams[pid].Parser)->pid=pid;
+ delete ((File_Mpeg_Psi*)Complete_Stream->Streams[PID].Parser); Complete_Stream->Streams[PID].Parser=new File_Mpeg_Psi;
+ Open_Buffer_Init(Complete_Stream->Streams[PID].Parser);
+ ((File_Mpeg_Psi*)Complete_Stream->Streams[PID].Parser)->Complete_Stream=Complete_Stream;
+ ((File_Mpeg_Psi*)Complete_Stream->Streams[PID].Parser)->PID=PID;
}
- else if (Complete_Stream->Streams[pid].Parser==NULL)
+ else if (Complete_Stream->Streams[PID].Parser==NULL)
{
Skip_XX(Element_Size, "data");
return; //This is not the start of the PSI
}
//Parsing
- Open_Buffer_Continue(Complete_Stream->Streams[pid].Parser);
+ Open_Buffer_Continue(Complete_Stream->Streams[PID].Parser);
//EPG
if (Status[IsFilled])
@@ -1550,20 +1561,20 @@ void File_MpegTs::PSI()
}
//Filling
- if (Complete_Stream->Streams[pid].Parser->Status[IsFinished])
+ if (Complete_Stream->Streams[PID].Parser->Status[IsFinished])
{
//Accept
- if (!Status[IsAccepted] && pid==0x0000 && Complete_Stream->Streams[pid].Parser->Status[IsAccepted])
+ if (!Status[IsAccepted] && PID==0x0000 && Complete_Stream->Streams[PID].Parser->Status[IsAccepted])
Accept("MPEG-TS");
//Disabling this PID
- delete Complete_Stream->Streams[pid].Parser; Complete_Stream->Streams[pid].Parser=NULL;
- Complete_Stream->Streams[pid].Searching_Payload_Start_Set(true);
- Complete_Stream->Streams[pid].Searching_Payload_Continue_Set(false);
+ delete Complete_Stream->Streams[PID].Parser; Complete_Stream->Streams[PID].Parser=NULL;
+ Complete_Stream->Streams[PID].Searching_Payload_Start_Set(true);
+ Complete_Stream->Streams[PID].Searching_Payload_Continue_Set(false);
}
else
//Waiting for more data
- Complete_Stream->Streams[pid].Searching_Payload_Continue_Set(true);
+ Complete_Stream->Streams[PID].Searching_Payload_Continue_Set(true);
}
//---------------------------------------------------------------------------
diff --git a/src/thirdparty/MediaInfo/Multiple/File_MpegTs.h b/src/thirdparty/MediaInfo/Multiple/File_MpegTs.h
index 6c749eace..980935bc7 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_MpegTs.h
+++ b/src/thirdparty/MediaInfo/Multiple/File_MpegTs.h
@@ -84,7 +84,7 @@ private :
#endif //MEDIAINFO_MPEGTS_PCR_YES
void Data_Parse();
- int16u pid;
+ int16u PID;
bool payload_unit_start_indicator;
//Global infos
diff --git a/src/thirdparty/MediaInfo/Multiple/File_MpegTs_Duplicate.cpp b/src/thirdparty/MediaInfo/Multiple/File_MpegTs_Duplicate.cpp
index 2000ef9c9..d6732349f 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_MpegTs_Duplicate.cpp
+++ b/src/thirdparty/MediaInfo/Multiple/File_MpegTs_Duplicate.cpp
@@ -90,14 +90,14 @@ void File_MpegTs::Option_Manage()
{
if (Duplicate->second->Wanted_program_numbers.find(Program->first)!=Duplicate->second->Wanted_program_numbers.end())
Wanted=true;
- if (Duplicate->second->Wanted_program_map_PIDs.find(Program->second.pid)!=Duplicate->second->Wanted_program_map_PIDs.end())
+ if (Duplicate->second->Wanted_program_map_PIDs.find(Program->second.PID)!=Duplicate->second->Wanted_program_map_PIDs.end())
Wanted=true;
}
//Enabling it if wanted
if (Wanted)
{
- Complete_Stream->Streams[Program->second.pid].ShouldDuplicate=true;
+ Complete_Stream->Streams[Program->second.PID].ShouldDuplicate=true;
for (size_t Pos=0; Pos<Program->second.elementary_PIDs.size(); Pos++)
Complete_Stream->Streams[Program->second.elementary_PIDs[Pos]].ShouldDuplicate=true;
}
diff --git a/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.cpp b/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.cpp
index fb44bd8a2..40e651228 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.cpp
+++ b/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.cpp
@@ -1169,7 +1169,7 @@ File_Mpeg_Descriptors::File_Mpeg_Descriptors()
//In
Complete_Stream=NULL;
transport_stream_id=0x0000;
- pid=0x0000;
+ PID=0x0000;
table_id=0x00;
table_id_extension=0x0000;
elementary_PID=0x0000;
@@ -2694,8 +2694,8 @@ void File_Mpeg_Descriptors::Descriptor_86()
if (event_id_IsValid)
{
- if (Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[pid].table_type].Events[event_id].Languages[caption_service_number].empty()) //We use only the first detected value
- Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[pid].table_type].Events[event_id].Languages[caption_service_number]=language;
+ if (Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[PID].table_type].Events[event_id].Languages[caption_service_number].empty()) //We use only the first detected value
+ Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[PID].table_type].Events[event_id].Languages[caption_service_number]=language;
}
if (elementary_PID_IsValid)
{
@@ -2873,9 +2873,9 @@ void File_Mpeg_Descriptors::CUEI_02()
Skip_B1( "segments_expected");
FILLING_BEGIN();
- for (size_t Program_Pos=0; Program_Pos<Complete_Stream->Streams[pid].program_numbers.size(); Program_Pos++)
+ for (size_t Program_Pos=0; Program_Pos<Complete_Stream->Streams[PID].program_numbers.size(); Program_Pos++)
{
- complete_stream::transport_stream::program::scte35* Scte35=Complete_Stream->Transport_Streams[transport_stream_id].Programs[Complete_Stream->Streams[pid].program_numbers[Program_Pos]].Scte35;
+ complete_stream::transport_stream::program::scte35* Scte35=Complete_Stream->Transport_Streams[transport_stream_id].Programs[Complete_Stream->Streams[PID].program_numbers[Program_Pos]].Scte35;
if (Scte35)
{
int8u Status=0; //Running
diff --git a/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.h b/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.h
index ce7a81f44..41b455e52 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.h
+++ b/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Descriptors.h
@@ -64,7 +64,7 @@ struct complete_stream
std::vector<int16u> elementary_PIDs;
size_t StreamPos; //Stream_Menu
int32u registration_format_identifier;
- int16u pid;
+ int16u PID;
int16u PCR_PID;
int16u program_number;
int16u source_id; //ATSC
@@ -132,7 +132,7 @@ struct complete_stream
HasChanged=false;
StreamPos=(size_t)-1;
registration_format_identifier=0x00000000;
- pid=0x00000;
+ PID=0x00000;
PCR_PID=0x0000;
program_number=0x0000;
source_id=0x0000;
@@ -453,7 +453,7 @@ public :
//In
complete_stream* Complete_Stream;
int16u transport_stream_id;
- int16u pid;
+ int16u PID;
int8u table_id;
int16u table_id_extension;
int16u elementary_PID;
diff --git a/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.cpp b/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.cpp
index e51b9f487..c40c20b85 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.cpp
+++ b/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.cpp
@@ -695,7 +695,7 @@ File_Mpeg_Psi::File_Mpeg_Psi()
//In
From_TS=true; //Default is from TS
Complete_Stream=NULL;
- pid=0x0000;
+ PID=0x0000;
//Temp
transport_stream_id=0x0000; //Impossible
@@ -1055,7 +1055,7 @@ void File_Mpeg_Psi::Table_00()
if (program_number)
{
Complete_Stream->Transport_Streams[table_id_extension].Programs_NotParsedCount++;
- Complete_Stream->Transport_Streams[table_id_extension].Programs[program_number].pid=elementary_PID;
+ Complete_Stream->Transport_Streams[table_id_extension].Programs[program_number].PID=elementary_PID;
if (Complete_Stream->Streams.size()<0x2000)
Complete_Stream->Streams.resize(0x2000); //TODO: find the reason this code is called
Complete_Stream->Streams[elementary_PID].program_numbers.push_back(program_number);
@@ -1870,14 +1870,14 @@ void File_Mpeg_Psi::Table_CB()
Element_End(Ztring::ToZtring_From_CC2(event_id));
FILLING_BEGIN();
- Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[pid].table_type].Events[event_id].start_time=start_time;
+ Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[PID].table_type].Events[event_id].start_time=start_time;
Ztring duration =(length_in_seconds<36000?_T("0"):_T(""))+Ztring::ToZtring(length_in_seconds/3600)+_T(":");
length_in_seconds%=3600;
duration+=(length_in_seconds< 600?_T("0"):_T(""))+Ztring::ToZtring(length_in_seconds/ 60)+_T(":");
length_in_seconds%=60;
duration+=(length_in_seconds< 10?_T("0"):_T(""))+Ztring::ToZtring(length_in_seconds );
- Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[pid].table_type].Events[event_id].duration=duration;
- Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[pid].table_type].Events[event_id].title=title;
+ Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[PID].table_type].Events[event_id].duration=duration;
+ Complete_Stream->Sources[table_id_extension].ATSC_EPG_Blocks[Complete_Stream->Streams[PID].table_type].Events[event_id].title=title;
FILLING_END();
}
}
@@ -1899,11 +1899,11 @@ void File_Mpeg_Psi::Table_CC()
ATSC_multiple_string_structure(extended_text_message, "extended_text_message");
FILLING_BEGIN();
- if (Complete_Stream->Streams[pid].table_type==4)
+ if (Complete_Stream->Streams[PID].table_type==4)
Complete_Stream->Sources[source_id].texts[table_id_extension]=extended_text_message;
else
{
- Complete_Stream->Sources[source_id].ATSC_EPG_Blocks[Complete_Stream->Streams[pid].table_type].Events[event_id].texts[table_id_extension]=extended_text_message;
+ Complete_Stream->Sources[source_id].ATSC_EPG_Blocks[Complete_Stream->Streams[PID].table_type].Events[event_id].texts[table_id_extension]=extended_text_message;
Complete_Stream->Sources[source_id].ATSC_EPG_Blocks_IsUpdated=true;
Complete_Stream->Sources_IsUpdated=true;
}
@@ -2130,7 +2130,7 @@ void File_Mpeg_Psi::Descriptors()
File_Mpeg_Descriptors Descriptors;
Descriptors.Complete_Stream=Complete_Stream;
Descriptors.transport_stream_id=transport_stream_id;
- Descriptors.pid=pid;
+ Descriptors.PID=PID;
Descriptors.table_id=table_id;
Descriptors.table_id_extension=table_id_extension;
Descriptors.elementary_PID=elementary_PID;
diff --git a/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.h b/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.h
index deef034a3..416cbd717 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.h
+++ b/src/thirdparty/MediaInfo/Multiple/File_Mpeg_Psi.h
@@ -46,7 +46,7 @@ public :
//In
bool From_TS;
complete_stream* Complete_Stream;
- int16u pid;
+ int16u PID;
public :
File_Mpeg_Psi();
diff --git a/src/thirdparty/MediaInfo/Multiple/File_Riff.cpp b/src/thirdparty/MediaInfo/Multiple/File_Riff.cpp
index 76fbce063..8cfc06391 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_Riff.cpp
+++ b/src/thirdparty/MediaInfo/Multiple/File_Riff.cpp
@@ -116,6 +116,7 @@ File_Riff::File_Riff()
avih_FrameRate=0;
avih_TotalFrame=0;
dmlh_TotalFrame=0;
+ indx_TotalFrame=0;
Idx1_Offset=(int64u)-1;
movi_Size=0;
TimeReference=(int64u)-1;
@@ -301,12 +302,17 @@ void File_Riff::Streams_Finish ()
//Duration
if (Temp->second.PacketCount>0)
{
- if (StreamKind_Last==Stream_Video)
+ if (StreamKind_Last==Stream_Video) // && Retrieve(Stream_Video, StreamPos_Last, Video_Duration).empty())
{
//Duration in case it is missing from header (malformed header...)
float32 FrameRate=Retrieve(Stream_Video, StreamPos_Last, Video_FrameRate).To_float32();
if (FrameRate>0)
- Fill(Stream_Video, StreamPos_Last, Video_Duration, Temp->second.PacketCount*1000/FrameRate, 0, true);
+ {
+ if (indx_TotalFrame)
+ Fill(Stream_Video, StreamPos_Last, Video_Duration, indx_TotalFrame*1000/FrameRate, 0, true);
+ else
+ Fill(Stream_Video, StreamPos_Last, Video_Duration, Temp->second.PacketCount*1000/FrameRate, 0, true);
+ }
}
if (StreamKind_Last==Stream_Audio)
{
diff --git a/src/thirdparty/MediaInfo/Multiple/File_Riff.h b/src/thirdparty/MediaInfo/Multiple/File_Riff.h
index 0a9a262f1..a00b13385 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_Riff.h
+++ b/src/thirdparty/MediaInfo/Multiple/File_Riff.h
@@ -134,6 +134,7 @@ private :
float64 avih_FrameRate; //FrameRate of the first video stream in one MOVI chunk
int32u avih_TotalFrame; //Count of frames in one MOVI chunk
int32u dmlh_TotalFrame; //Count of frames in the whole AVI file (with odml too)
+ int64u indx_TotalFrame; //Count of frames in the super index
int64u Idx1_Offset; //Pos of the data part (AVI) for Idx1 chunk
int64u movi_Size; //Size of the data part (AVI and AVIX)
int64u TimeReference; //Only used by Brodcast extension
diff --git a/src/thirdparty/MediaInfo/Multiple/File_Riff_Elements.cpp b/src/thirdparty/MediaInfo/Multiple/File_Riff_Elements.cpp
index 119d9f8b1..9664289d9 100644
--- a/src/thirdparty/MediaInfo/Multiple/File_Riff_Elements.cpp
+++ b/src/thirdparty/MediaInfo/Multiple/File_Riff_Elements.cpp
@@ -1020,19 +1020,29 @@ void File_Riff::AVI__hdlr_strl_indx_SuperIndex(int32u Entry_Count, int32u ChunkI
//Parsing
int64u Offset;
+ int64u Index_Duration=0;
Skip_L4( "Reserved0");
Skip_L4( "Reserved1");
Skip_L4( "Reserved2");
for (int32u Pos=0; Pos<Entry_Count; Pos++)
{
+ int32u Duration;
Element_Begin("Index of Indexes");
Get_L8 (Offset, "Offset");
Skip_L4( "Size"); //Size of index chunk at this offset
- Skip_L4( "Duration"); //time span in stream ticks
+ Get_L4 (Duration, "Duration"); //time span in stream ticks
Index_Pos[Offset]=ChunkId;
+ Index_Duration+=Duration;
Element_End();
}
+ //For video
+ if (StreamKind_Last==Stream_Video && avih_FrameRate)
+ {
+ indx_TotalFrame=Index_Duration;
+ //Fill(Stream_Video, StreamPos_Last, Video_Duration, Index_Duration*1000/avih_FrameRate, 0, true);
+ }
+
//We needn't anymore Old version
NeedOldIndex=false;
}
diff --git a/src/thirdparty/MediaInfo/Video/File_Mpegv.cpp b/src/thirdparty/MediaInfo/Video/File_Mpegv.cpp
index cabe359a4..18c6ad2d3 100644
--- a/src/thirdparty/MediaInfo/Video/File_Mpegv.cpp
+++ b/src/thirdparty/MediaInfo/Video/File_Mpegv.cpp
@@ -722,6 +722,39 @@ void File_Mpegv::Streams_Finish()
delete TemporalReference[Pos]; //TemporalReference[Pos]=NULL;
TemporalReference.clear();
}
+
+ //Commercial name
+ if (Retrieve(Stream_Video, 0, Video_Format_Version)==_T("Version 2")
+ && Retrieve(Stream_Video, 0, Video_DisplayAspectRatio)==_T("1.778")
+ && Retrieve(Stream_Video, 0, Video_BitDepth)==_T("8")
+ && Retrieve(Stream_Video, 0, Video_ChromaSubsampling)==_T("4:2:0"))
+ {
+ //HDV1
+ if (Retrieve(Stream_Video, 0, Video_Width)==_T("1280")
+ && Retrieve(Stream_Video, 0, Video_Height)==_T("720")
+ && Retrieve(Stream_Video, 0, Video_ScanType)==_T("Progressive")
+ && (Retrieve(Stream_Video, 0, Video_FrameRate)==_T("60.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("59.940") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("30.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("29.970") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("24.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("23.976") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("50.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("25.000"))
+ && (Retrieve(Stream_Video, 0, Video_Format_Profile)==_T("Main@High") || Retrieve(Stream_Video, 0, Video_Format_Profile)==_T("Main@High 1440"))
+ && Retrieve(Stream_Video, 0, Video_BitRate).To_int64u()<20000000 && Retrieve(Stream_Video, 0, Video_BitRate_Nominal).To_int64u()<20000000)
+ Fill(Stream_Video, 0, Video_Format_Commercial_IfAny, "HDV 720p");
+
+ //HDV2
+ if (Retrieve(Stream_Video, 0, Video_Width)==_T("1440")
+ && Retrieve(Stream_Video, 0, Video_Height)==_T("1080")
+ && Retrieve(Stream_Video, 0, Video_Format_Profile)==_T("Main@High 1440")
+ && Retrieve(Stream_Video, 0, Video_BitRate).To_int64u()<27000000 && Retrieve(Stream_Video, 0, Video_BitRate_Nominal).To_int64u()<27000000)
+ {
+ //Interlaced
+ if (Retrieve(Stream_Video, 0, Video_ScanType)==_T("Interlaced")
+ && (Retrieve(Stream_Video, 0, Video_FrameRate)==_T("30.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("29.970") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("50.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("25.000")))
+ Fill(Stream_Video, 0, Video_Format_Commercial_IfAny, "HDV 1080i");
+
+ //Progressive
+ if (Retrieve(Stream_Video, 0, Video_ScanType)==_T("Progressive")
+ && (Retrieve(Stream_Video, 0, Video_FrameRate)==_T("30.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("29.970") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("24.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("23.976") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("50.000") || Retrieve(Stream_Video, 0, Video_FrameRate)==_T("25.000")))
+ Fill(Stream_Video, 0, Video_Format_Commercial_IfAny, "HDV 1080p");
+ }
+ }
}
//***************************************************************************
@@ -1063,16 +1096,19 @@ void File_Mpegv::picture_start()
FILLING_BEGIN();
//Timestamp
- if (Time_Begin_Seconds==Error)
+ if (!group_start_IsParsed || (group_start_closed_gop==true && temporal_reference==0) || group_start_closed_gop==false)
{
- //Verifying if time_code is trustable
- if (Time_Current_Seconds==Time_Begin_Seconds && Time_Current_Frames+temporal_reference==Time_Begin_Frames)
- Time_End_NeedComplete=true; //we can't trust time_code
- }
- if (Time_Begin_Seconds==Error)
- {
- Time_Begin_Seconds=Time_Current_Seconds;
- Time_Begin_Frames =Time_Current_Frames+temporal_reference;
+ if (Time_Begin_Seconds==Error)
+ {
+ //Verifying if time_code is trustable
+ if (Time_Current_Seconds==Time_Begin_Seconds && Time_Current_Frames+temporal_reference==Time_Begin_Frames)
+ Time_End_NeedComplete=true; //we can't trust time_code
+ }
+ if (Time_Begin_Seconds==Error)
+ {
+ Time_Begin_Seconds=Time_Current_Seconds;
+ Time_Begin_Frames =Time_Current_Frames+temporal_reference;
+ }
}
if (!Time_End_NeedComplete && (Time_End_Seconds==Error || Time_Current_Seconds*FrameRate+Time_Current_Frames+temporal_reference>Time_End_Seconds*FrameRate+Time_End_Frames))
{
diff --git a/src/thirdparty/lcms2/src/cmslut.c b/src/thirdparty/lcms2/src/cmslut.c
index 3f6dda9fe..a13827e57 100644
--- a/src/thirdparty/lcms2/src/cmslut.c
+++ b/src/thirdparty/lcms2/src/cmslut.c
@@ -252,6 +252,8 @@ cmsStage* CMSEXPORT cmsStageAllocToneCurves(cmsContext ContextID, cmsUInt32Numbe
return NULL;
}
+ NewMPE ->Data = (void*) NewElem;
+
NewElem ->nCurves = nChannels;
NewElem ->TheCurves = (cmsToneCurve**) _cmsCalloc(ContextID, nChannels, sizeof(cmsToneCurve*));
if (NewElem ->TheCurves == NULL) {
@@ -274,8 +276,6 @@ cmsStage* CMSEXPORT cmsStageAllocToneCurves(cmsContext ContextID, cmsUInt32Numbe
}
}
- NewMPE ->Data = (void*) NewElem;
-
return NewMPE;
}
@@ -526,7 +526,12 @@ cmsStage* CMSEXPORT cmsStageAllocCLut16bitGranular(cmsContext ContextID,
if (NewMPE == NULL) return NULL;
NewElem = (_cmsStageCLutData*) _cmsMalloc(ContextID, sizeof(_cmsStageCLutData));
- if (NewElem == NULL) return NULL;
+ if (NewElem == NULL) {
+ cmsStageFree(NewMPE);
+ return NULL;
+ }
+
+ NewMPE ->Data = (void*) NewElem;
NewElem -> nEntries = n = outputChan * CubeSize(clutPoints, inputChan);
NewElem -> HasFloatValues = FALSE;
@@ -549,8 +554,6 @@ cmsStage* CMSEXPORT cmsStageAllocCLut16bitGranular(cmsContext ContextID,
return NULL;
}
- NewMPE ->Data = (void*) NewElem;
-
return NewMPE;
}
@@ -601,7 +604,12 @@ cmsStage* CMSEXPORT cmsStageAllocCLutFloatGranular(cmsContext ContextID, const c
NewElem = (_cmsStageCLutData*) _cmsMalloc(ContextID, sizeof(_cmsStageCLutData));
- if (NewElem == NULL) return NULL;
+ if (NewElem == NULL) {
+ cmsStageFree(NewMPE);
+ return NULL;
+ }
+
+ NewMPE ->Data = (void*) NewElem;
NewElem -> nEntries = n = outputChan * CubeSize( clutPoints, inputChan);
NewElem -> HasFloatValues = TRUE;
@@ -618,8 +626,7 @@ cmsStage* CMSEXPORT cmsStageAllocCLutFloatGranular(cmsContext ContextID, const c
}
}
- NewMPE ->Data = (void*) NewElem;
-
+
NewElem ->Params = _cmsComputeInterpParamsEx(ContextID, clutPoints, inputChan, outputChan, NewElem ->Tab.TFloat, CMS_LERP_FLAGS_FLOAT);
if (NewElem ->Params == NULL) {
cmsStageFree(NewMPE);
diff --git a/src/thirdparty/lcms2/src/cmstypes.c b/src/thirdparty/lcms2/src/cmstypes.c
index 6ab69e6b2..27c317ac9 100644
--- a/src/thirdparty/lcms2/src/cmstypes.c
+++ b/src/thirdparty/lcms2/src/cmstypes.c
@@ -2039,10 +2039,17 @@ void *Type_LUT16_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cm
T = (cmsUInt16Number*) _cmsCalloc(self ->ContextID, nTabSize, sizeof(cmsUInt16Number));
if (T == NULL) goto Error;
- if (!_cmsReadUInt16Array(io, nTabSize, T)) goto Error;
+ if (!_cmsReadUInt16Array(io, nTabSize, T)) {
+ _cmsFree(self ->ContextID, T);
+ goto Error;
+ }
mpeclut = cmsStageAllocCLut16bit(self ->ContextID, CLUTpoints, InputChannels, OutputChannels, T);
- if (mpeclut == NULL) goto Error;
+ if (mpeclut == NULL) {
+ _cmsFree(self ->ContextID, T);
+ goto Error;
+ }
+
cmsPipelineInsertStage(NewLUT, cmsAT_END, mpeclut);
_cmsFree(self ->ContextID, T);
}