From fd34d08ae0f2a61b417c09c1b5f2d288e58b469b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 7 Oct 2004 04:55:31 +0000 Subject: [PATCH] fix some AVIs skipping frames --- .../src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 99387ecb4f..6a29195d86 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -148,7 +148,7 @@ public: float LastFrameDelay; - float pts, last_IP_pts; + float pts; avcodec::AVPacket pkt; int current_packet_offset; @@ -195,7 +195,7 @@ void FFMpeg_Helper::Init() GetNextTimestamp = true; CurrentTimestamp = 0, Last_IP_Timestamp = 0; LastFrameDelay = 0; - pts = last_IP_pts = -1; + pts = -1; FrameNumber = -1; /* decode one frame and you're on the 0th */ TimestampOffset = 0; @@ -306,8 +306,8 @@ int FFMpeg_Helper::DecodePacket() { if ( GetNextTimestamp ) { - if (pkt.pts != int64_t(AV_NOPTS_VALUE)) - pts = (float)pkt.pts / AV_TIME_BASE; + if (pkt.dts != int64_t(AV_NOPTS_VALUE)) + pts = (float)pkt.dts / AV_TIME_BASE; else pts = -1; GetNextTimestamp = false; @@ -345,12 +345,6 @@ int FFMpeg_Helper::DecodePacket() GetNextTimestamp = true; - if ( m_stream->codec.has_b_frames && - frame.pict_type != FF_B_TYPE ) - { - swap( pts, last_IP_pts ); - } - if (pts != -1) { CurrentTimestamp = pts;