summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2015-03-03 21:40:00 +0100
committerThomas Reufer <thomas@reufer.ch>2015-03-03 21:40:00 +0100
commita30995b5241d469f88c4dd16ed4635f45a57876c (patch)
treeba0496a644dbd3907e7760f09c45d63fce21257d
parentcad592391151947aa9a168188cb02fb7b83f2600 (diff)
downloadvdr-plugin-rpihddevice-a30995b5241d469f88c4dd16ed4635f45a57876c.tar.gz
vdr-plugin-rpihddevice-a30995b5241d469f88c4dd16ed4635f45a57876c.tar.bz2
improved video frame rate detection to be more tolerant to inaccurate values
-rw-r--r--HISTORY1
-rw-r--r--omx.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 0bd6fc9..657e8da 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2,6 +2,7 @@ VDR Plugin 'rpihddevice' Revision History
-----------------------------------------
- fixed:
+ - improved video frame rate detection to be more tolerant to inaccurate values
- adapted cOvgRawOsd::Flush() to new cOsd::RenderPixmaps() of vdr-2.1.10
- fixed calculation of string height (reported by Klaus Schmidinger)
- additionally set number of in/out channels when setting up audio resampler
diff --git a/omx.c b/omx.c
index 5bc4619..1bd1ded 100644
--- a/omx.c
+++ b/omx.c
@@ -239,8 +239,11 @@ void cOmx::HandlePortSettingsChanged(unsigned int portId)
m_videoFormat.width = portdef.format.video.nFrameWidth;
m_videoFormat.height = portdef.format.video.nFrameHeight;
m_videoFormat.interlaced = interlace.eMode != OMX_InterlaceProgressive;
- m_videoFormat.frameRate =
- ALIGN_UP(portdef.format.video.xFramerate, 1 << 16) >> 16;
+
+ // discard 4 least significant bits, since there might be some deviation
+ // due to jitter in time stamps
+ m_videoFormat.frameRate = ALIGN_UP(
+ portdef.format.video.xFramerate & 0xfffffff0, 1 << 16) >> 16;
// workaround for progressive streams detected as interlaced video by
// the decoder due to missing SEI parsing