Skip to content

Commit

Permalink
DVDPlayerVideo: introduce a flag in order to ignore pts for pullup co…
Browse files Browse the repository at this point in the history
…rrection, vdpau deinterlacing ruins pattern
  • Loading branch information
FernetMenta committed Jan 7, 2012
1 parent 9c04763 commit e2448c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h
Expand Up @@ -125,6 +125,7 @@ struct DVDVideoUserData

#define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped
#define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data
#define DVP_FLAG_IGNORE_PTS 0x00000040 // indicate that pts of this pic shall be ignored by pullup correction

// DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2!

Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
Expand Up @@ -1562,6 +1562,7 @@ bool CVDPAU::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture*
{
picture->dts = DVD_NOPTS_VALUE;
picture->pts = DVD_NOPTS_VALUE;
picture->iFlags |= DVP_FLAG_IGNORE_PTS;
}
}
return true;
Expand Down
13 changes: 8 additions & 5 deletions xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Expand Up @@ -1094,12 +1094,15 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts)
if(m_fFrameRate * abs(m_speed) / DVD_PLAYSPEED_NORMAL > maxfps*0.9)
limited = true;

//correct any pattern in the timestamps
m_pullupCorrection.Add(pts);
pts += m_pullupCorrection.GetCorrection();
if (!(picture.iFlags & DVP_FLAG_IGNORE_PTS))
{
//correct any pattern in the timestamps
m_pullupCorrection.Add(pts);
pts += m_pullupCorrection.GetCorrection();

//try to calculate the framerate
CalcFrameRate();
//try to calculate the framerate
CalcFrameRate();
}

// signal to clock what our framerate is, it may want to adjust it's
// speed to better match with our video renderer's output speed
Expand Down

0 comments on commit e2448c6

Please sign in to comment.