|
From: rainbyte <rai...@us...> - 2012-07-22 00:13:23
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jul 10 06:18:44 2012 +0300
Revert "Fix video playback issue in dance mode."
This reverts commit b049a44b8966e8a27f2a91793956322eb2c8d335.
packet.pts contains incorrect timecode, causing B frames to be displayed
out of order. Yes, "pts" stands for "presentation time stamp" but apparently
it still contains decode time stamp values. The timecode system of libav is
retarded.
---
game/ffmpeg.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 616384e..e4440ed 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -161,8 +161,8 @@ void FFmpeg::decodePacket() {
packetSize -= decodeSize; // Move forward within the packet
if (!frameFinished) continue;
// Update current position if timecode is available
- if (packet.pts != int64_t(AV_NOPTS_VALUE)) {
- m_position = double(packet.pts) * av_q2d(m_formatContext->streams[m_streamId]->time_base);
+ if (frame->pkt_pts != uint64_t(AV_NOPTS_VALUE)) {
+ m_position = double(frame->pkt_pts) * av_q2d(m_formatContext->streams[m_streamId]->time_base);
}
if (m_mediaType == AVMEDIA_TYPE_VIDEO) processVideo(frame); else processAudio(frame);
}
|