From d8d9f466a9ac8ce814a20e8964aa7c87eead546f Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Fri, 23 Aug 2013 00:08:25 -0400 Subject: [PATCH] FFmpeg: remove unused PTS logic No-op. --- src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 20 ------------------- src/arch/MovieTexture/MovieTexture_FFMpeg.h | 2 -- 2 files changed, 22 deletions(-) diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 2389f3bd76..51cfbd5924 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -144,10 +144,8 @@ MovieDecoder_FFMpeg::~MovieDecoder_FFMpeg() void MovieDecoder_FFMpeg::Init() { m_iEOF = 0; - m_bGetNextTimestamp = true; m_fTimestamp = 0; m_fLastFrameDelay = 0; - m_fPTS = -1; m_iFrameNumber = -1; /* decode one frame and you're on the 0th */ m_fTimestampOffset = 0; m_fLastFrame = 0; @@ -250,22 +248,6 @@ int MovieDecoder_FFMpeg::DecodePacket( float fTargetTime ) while( m_iEOF == 1 || (m_iEOF == 0 && m_iCurrentPacketOffset < m_Packet.size) ) { - if( m_bGetNextTimestamp ) - { - if (m_Packet.dts != int64_t(AV_NOPTS_VALUE)) - { - m_fPTS = float( m_Packet.dts * av_q2d(m_pStream->time_base) ); - - /* dts is the timestamp of the first frame in this packet. Only use it once; - * if we get more than one frame from the same packet (eg. flushing the last - * frame), extrapolate. */ - m_Packet.dts = int64_t(AV_NOPTS_VALUE); - } - else - m_fPTS = -1; - m_bGetNextTimestamp = false; - } - /* If we have no data on the first frame, just return EOF; passing an empty packet * to avcodec_decode_video in this case is crashing it. However, passing an empty * packet is normal with B-frames, to flush. This may be unnecessary in newer @@ -304,8 +286,6 @@ int MovieDecoder_FFMpeg::DecodePacket( float fTargetTime ) continue; } - m_bGetNextTimestamp = true; - if( m_Frame.pkt_dts != AV_NOPTS_VALUE ) { m_fTimestamp = (float) (m_Frame.pkt_dts * av_q2d(m_pStream->time_base)); diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.h b/src/arch/MovieTexture/MovieTexture_FFMpeg.h index b659153e47..0c017d8e2f 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.h +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.h @@ -67,9 +67,7 @@ private: avcodec::PixelFormat m_AVTexfmt; /* PixelFormat of output surface */ avcodec::SwsContext *m_swsctx; - float m_fPTS; avcodec::AVFormatContext *m_fctx; - bool m_bGetNextTimestamp; float m_fTimestamp; float m_fTimestampOffset; float m_fLastFrameDelay;