FFMS2: Use the average fps for files opened with Haali's splitters

Originally committed to SVN as r2977.
This commit is contained in:
Fredrik Mellbin 2009-05-22 23:41:37 +00:00
parent cb1a9ba0b3
commit 3a7618cd64
2 changed files with 8 additions and 1 deletions

View File

@ -13,7 +13,6 @@ Opens files using ffmpeg and nothing else. May be frame accurate on good days. T
<h2>Known issues</h2>
<ul>
<li>Requires <a href='http://haali.cs.msu.ru/mkv/'>Haali's Media Splitter</a> if ogm or mpeg ps/ts is to be opened.</li>
<li>Haali's Media Splitter is used the reported framerate is always 30</li>
<li>Avi files with NVOPs (sometimes occurs in xvid and such) will desync when these frames are encountered. Remux to mkv/mp4 before opening to solve it for now.</li>
<li>The audio sources still aren't sample accurate and sometimes exhibit many interesting issues. This is however more likely to be an issues when not using a 32bit windows compile. Dumping the audio during indexing is the only workaround.
</ul>
@ -240,6 +239,7 @@ Note that --enable-w32threads or --enable-pthreads is required for multithreaded
<h2>Changes</h2>
<ul>
<li>2.00 beta 9<ul>
<li>Now uses the average framerate for files opened with Haali's splitters, before it was always reported as 30 fps</li>
<li>Implemented audio decoding using Haali's splitters, FFAudioSource now works on ts, ps and ogm</li>
<li>Can now be compiled with ICL 10.1 (probably other versions too)</li>
<li>How indexing works has been split internally so the track numbers and types are reported, this makes it possible to create an interactive GUI or ask which audio tracks are to be indexed</li>

View File

@ -721,6 +721,13 @@ FFHaaliVideo::FFHaaliVideo(const char *SourceFile, int Track,
throw ErrorMsg;
}
// Calculate the average framerate
if (Frames.size() >= 2) {
double DTSDiff = (double)(Frames.back().DTS - Frames.front().DTS);
VP.FPSDenominator = (unsigned int)(DTSDiff / (double)1000 / (double)(VP.NumFrames - 1) + 0.5);
VP.FPSNumerator = 1000000;
}
// Output the already decoded frame so it isn't wasted
OutputFrame(DecodeFrame);