From df543ff86ccbf89af49171e61617b38c1c907283 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Fri, 23 Aug 2013 00:02:07 -0400 Subject: [PATCH] FFmpeg: use the cached pkt_dts for timestamps This appears to work far more consistently at the beginnings and ends of videos. --- src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 64760ad4ca..2389f3bd76 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -306,9 +306,9 @@ int MovieDecoder_FFMpeg::DecodePacket( float fTargetTime ) m_bGetNextTimestamp = true; - if( m_fPTS != -1 ) + if( m_Frame.pkt_dts != AV_NOPTS_VALUE ) { - m_fTimestamp = m_fPTS; + m_fTimestamp = (float) (m_Frame.pkt_dts * av_q2d(m_pStream->time_base)); } else {