diff options
author | Thomas Reufer <thomas@reufer.ch> | 2014-12-30 17:11:18 +0100 |
---|---|---|
committer | Thomas Reufer <thomas@reufer.ch> | 2014-12-30 17:11:18 +0100 |
commit | 69f2e196321ce155f61e7253c8abd2b0fcc6c94c (patch) | |
tree | c2285be596fd4eb162e4331c10abcfae9549600a | |
parent | 0fe3d570d463b5bddbdc33f155751106ae13f46e (diff) | |
download | vdr-plugin-rpihddevice-69f2e196321ce155f61e7253c8abd2b0fcc6c94c.tar.gz vdr-plugin-rpihddevice-69f2e196321ce155f61e7253c8abd2b0fcc6c94c.tar.bz2 |
manually overriding interlaced flag when detected frame rate looks implausible
-rw-r--r-- | omx.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -241,6 +241,17 @@ void cOmx::HandlePortSettingsChanged(unsigned int portId) m_videoFormat.interlaced = interlace.eMode != OMX_InterlaceProgressive; m_videoFormat.frameRate = ALIGN_UP(portdef.format.video.xFramerate, 1 << 16) >> 16; + + // workaround for progressive streams detected as interlaced video by + // the decoder due to missing SEI parsing + // see: https://github.com/raspberrypi/firmware/issues/283 + if (m_videoFormat.interlaced && m_videoFormat.frameRate >= 50) + { + DLOG("%di looks implausible, manually overriding interlaced flag", + m_videoFormat.frameRate * 2); + m_videoFormat.interlaced = false; + } + if (m_videoFormat.interlaced) m_videoFormat.frameRate = m_videoFormat.frameRate * 2; @@ -261,8 +272,14 @@ void cOmx::HandlePortSettingsChanged(unsigned int portId) bool fastDeinterlace = portdef.format.video.nFrameWidth * portdef.format.video.nFrameHeight > 576 * 720; - filterparam.nNumParams = 1; + filterparam.nNumParams = fastDeinterlace ? 1 : 2; filterparam.nParams[0] = 3; + + // explicitly set frame interval for advanced deinterlacer + // see: https://github.com/raspberrypi/firmware/issues/234 + filterparam.nParams[1] = 1000000 / + (portdef.format.video.xFramerate >> 16); + filterparam.eImageFilter = fastDeinterlace ? OMX_ImageFilterDeInterlaceFast : OMX_ImageFilterDeInterlaceAdvanced; |