Page MenuHome

VideoFFmpeg.diff

File Metadata

Author
Anders Gudmundson (anders_gud)
Created
Nov 13 2013, 3:16 PM

VideoFFmpeg.diff

--- source/gameengine/VideoTexture/VideoFFmpeg.cpp-bak 2011-01-07 12:58:17.891533638 +0100
+++ source/gameengine/VideoTexture/VideoFFmpeg.cpp 2011-01-07 21:35:58.345749957 +0100
@@ -213,7 +213,16 @@
codecCtx->frame_rate_base=1000;
m_baseFrameRate = (double)codecCtx->frame_rate / (double)codecCtx->frame_rate_base;
#else
- m_baseFrameRate = av_q2d(formatCtx->streams[videoStream]->r_frame_rate);
+ if (formatCtx->streams[videoStream]->avg_frame_rate.den &&
+ formatCtx->streams[videoStream]->avg_frame_rate.num) {
+ m_baseFrameRate = av_q2d(formatCtx->streams[videoStream]->avg_frame_rate);
+ }else{
+ m_baseFrameRate = av_q2d(formatCtx->streams[videoStream]->r_frame_rate);
+ }
+ if (m_baseFrameRate != m_baseFrameRate) {
+ m_baseFrameRate = av_q2d(formatCtx->streams[videoStream]->r_frame_rate);
+ }
+
#endif
if (m_baseFrameRate <= 0.0)
m_baseFrameRate = defFrameRate;

Event Timeline