Fixed some critical mkv loading issues.

Originally committed to SVN as r1619.
This commit is contained in:
Rodrigo Braz Monteiro 2007-10-22 20:10:35 +00:00
parent 41f3dcc35d
commit 45f5886c2a
3 changed files with 7 additions and 40 deletions

View file

@ -248,13 +248,13 @@ void MatroskaWrapper::SetToTimecodes(FrameRate &target) {
// Check if it's CFR // Check if it's CFR
bool isCFR = true; bool isCFR = true;
double estimateCFR = timecodes.back() / timecodes.size()-1; double estimateCFR = timecodes.back() / (timecodes.size()-1);
double t1,t2; double t1,t2;
for (int i=1;i<frames;i++) { for (int i=1;i<frames;i++) {
t1 = timecodes[i]; t1 = timecodes[i];
t2 = timecodes[i-1]; t2 = timecodes[i-1];
int delta = int(t1 - t2 - estimateCFR); int delta = abs(int(t1 - t2 - estimateCFR));
if (abs(delta > 2)) { if (delta > 2) {
isCFR = false; isCFR = false;
break; break;
} }
@ -262,8 +262,9 @@ void MatroskaWrapper::SetToTimecodes(FrameRate &target) {
// Constant framerate // Constant framerate
if (isCFR) { if (isCFR) {
if (fabs(estimateCFR - 23.976) < 0.01) estimateCFR = 24000.0 / 1001.0; estimateCFR = 1/estimateCFR * 1000.0;
if (fabs(estimateCFR - 29.97) < 0.01) estimateCFR = 30000.0 / 1001.0; if (fabs(estimateCFR - 24000.0/1001.0) < 0.02) estimateCFR = 24000.0 / 1001.0;
if (fabs(estimateCFR - 30000.0/1001.0) < 0.02) estimateCFR = 30000.0 / 1001.0;
target.SetCFR(estimateCFR); target.SetCFR(estimateCFR);
} }

View file

@ -1,24 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsfilter", "vsfilter.vcproj", "{7A3950FD-A235-459A-ACA2-5170863CD32C}"
ProjectSection(ProjectDependencies) = postProject
{11B20554-2747-469C-9093-3345B1D99E0C} = {11B20554-2747-469C-9093-3345B1D99E0C}
{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6} = {5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}
{6BB08A9D-BBD3-433A-A6D9-079C84EBE270} = {6BB08A9D-BBD3-433A-A6D9-079C84EBE270}
{B0CD35D2-65C8-48D0-BEC8-D235137F62F6} = {B0CD35D2-65C8-48D0-BEC8-D235137F62F6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subtitles", "subtitles\subtitles.vcproj", "{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}"
ProjectSection(ProjectDependencies) = postProject
{11B20554-2747-469C-9093-3345B1D99E0C} = {11B20554-2747-469C-9093-3345B1D99E0C}
{971851AB-A612-4F2F-866F-F0FA152EFFB2} = {971851AB-A612-4F2F-866F-F0FA152EFFB2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subpic", "subpic\subpic.vcproj", "{11B20554-2747-469C-9093-3345B1D99E0C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libssf", "libssf\libssf.vcproj", "{971851AB-A612-4F2F-866F-F0FA152EFFB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsutil", "dsutil\dsutil.vcproj", "{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsutil", "dsutil\dsutil.vcproj", "{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basevideofilter", "basevideofilter\basevideofilter.vcproj", "{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basevideofilter", "basevideofilter\basevideofilter.vcproj", "{B0CD35D2-65C8-48D0-BEC8-D235137F62F6}"
@ -29,22 +11,6 @@ Global
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A3950FD-A235-459A-ACA2-5170863CD32C}.Debug|Win32.ActiveCfg = Debug|Win32
{7A3950FD-A235-459A-ACA2-5170863CD32C}.Debug|Win32.Build.0 = Debug|Win32
{7A3950FD-A235-459A-ACA2-5170863CD32C}.Release|Win32.ActiveCfg = Release|Win32
{7A3950FD-A235-459A-ACA2-5170863CD32C}.Release|Win32.Build.0 = Release|Win32
{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Debug|Win32.ActiveCfg = Debug|Win32
{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Debug|Win32.Build.0 = Debug|Win32
{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Release|Win32.ActiveCfg = Release|Win32
{6BB08A9D-BBD3-433A-A6D9-079C84EBE270}.Release|Win32.Build.0 = Release|Win32
{11B20554-2747-469C-9093-3345B1D99E0C}.Debug|Win32.ActiveCfg = Debug|Win32
{11B20554-2747-469C-9093-3345B1D99E0C}.Debug|Win32.Build.0 = Debug|Win32
{11B20554-2747-469C-9093-3345B1D99E0C}.Release|Win32.ActiveCfg = Release|Win32
{11B20554-2747-469C-9093-3345B1D99E0C}.Release|Win32.Build.0 = Release|Win32
{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Debug|Win32.ActiveCfg = Debug|Win32
{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Debug|Win32.Build.0 = Debug|Win32
{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Release|Win32.ActiveCfg = Release|Win32
{971851AB-A612-4F2F-866F-F0FA152EFFB2}.Release|Win32.Build.0 = Release|Win32
{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug|Win32.ActiveCfg = Debug|Win32 {5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug|Win32.ActiveCfg = Debug|Win32
{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug|Win32.Build.0 = Debug|Win32 {5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Debug|Win32.Build.0 = Debug|Win32
{5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Release|Win32.ActiveCfg = Release|Win32 {5F6E4984-0E0A-468D-8EF5-AE52AE8CBBF6}.Release|Win32.ActiveCfg = Release|Win32

View file

@ -147,7 +147,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="delayimp.lib strmbaseu.lib" AdditionalDependencies="delayimp.lib strmbaseu.lib winmm.lib"
LinkIncremental="1" LinkIncremental="1"
ModuleDefinitionFile=".\vsfilter.def" ModuleDefinitionFile=".\vsfilter.def"
GenerateDebugInformation="true" GenerateDebugInformation="true"