diff --git a/aegisub/FFmpegSource2/ffms2.html b/aegisub/FFmpegSource2/ffms2.html
index 9d82af309..d48ade70d 100644
--- a/aegisub/FFmpegSource2/ffms2.html
+++ b/aegisub/FFmpegSource2/ffms2.html
@@ -13,7 +13,6 @@ Opens files using ffmpeg and nothing else. May be frame accurate on good days. T
Known issues
- Requires Haali's Media Splitter if ogm or mpeg ps/ts is to be opened.
-- Haali's Media Splitter is used the reported framerate is always 30
- 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.
- 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.
@@ -240,6 +239,7 @@ Note that --enable-w32threads or --enable-pthreads is required for multithreaded
Changes
- 2.00 beta 9
+- Now uses the average framerate for files opened with Haali's splitters, before it was always reported as 30 fps
- Implemented audio decoding using Haali's splitters, FFAudioSource now works on ts, ps and ogm
- Can now be compiled with ICL 10.1 (probably other versions too)
- 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
diff --git a/aegisub/FFmpegSource2/ffvideosource.cpp b/aegisub/FFmpegSource2/ffvideosource.cpp
index f2c1008ae..d8c1bcca8 100644
--- a/aegisub/FFmpegSource2/ffvideosource.cpp
+++ b/aegisub/FFmpegSource2/ffvideosource.cpp
@@ -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);