Skip to content

Commit

Permalink
Revert "VideoPlayer: drop obsolete irFpsScale"
Browse files Browse the repository at this point in the history
This reverts commit 51ebe16.
  • Loading branch information
popcornmix committed Jun 16, 2016
1 parent b156cad commit 8be1c65
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h
Expand Up @@ -148,6 +148,8 @@ class CDemuxStreamVideo : public CDemuxStream
{ {
iFpsScale = 0; iFpsScale = 0;
iFpsRate = 0; iFpsRate = 0;
irFpsScale = 0;
irFpsRate = 0;
iHeight = 0; iHeight = 0;
iWidth = 0; iWidth = 0;
fAspect = 0.0; fAspect = 0.0;
Expand All @@ -163,6 +165,8 @@ class CDemuxStreamVideo : public CDemuxStream
virtual ~CDemuxStreamVideo() {} virtual ~CDemuxStreamVideo() {}
int iFpsScale; // scale of 1000 and a rate of 29970 will result in 29.97 fps int iFpsScale; // scale of 1000 and a rate of 29970 will result in 29.97 fps
int iFpsRate; int iFpsRate;
int irFpsScale;
int irFpsRate;
int iHeight; // height of the stream reported by the demuxer int iHeight; // height of the stream reported by the demuxer
int iWidth; // width of the stream reported by the demuxer int iWidth; // width of the stream reported by the demuxer
float fAspect; // display aspect of stream float fAspect; // display aspect of stream
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp
Expand Up @@ -418,6 +418,8 @@ void CDVDDemuxClient::RequestStreams()


streamVideo->iFpsScale = source->iFpsScale; streamVideo->iFpsScale = source->iFpsScale;
streamVideo->iFpsRate = source->iFpsRate; streamVideo->iFpsRate = source->iFpsRate;
streamVideo->irFpsScale = source->irFpsScale;
streamVideo->irFpsRate = source->irFpsRate;
streamVideo->iHeight = source->iHeight; streamVideo->iHeight = source->iHeight;
streamVideo->iWidth = source->iWidth; streamVideo->iWidth = source->iWidth;
streamVideo->fAspect = source->fAspect; streamVideo->fAspect = source->fAspect;
Expand Down
18 changes: 15 additions & 3 deletions xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
Expand Up @@ -1279,9 +1279,21 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx)
st->iFpsScale = 0; st->iFpsScale = 0;
} }


if (pStream->codec_info_nb_frames > 0 && // added for aml hw decoder, mkv frame-rate can be wrong.
pStream->codec_info_nb_frames <= 2 && if (r_frame_rate.den && r_frame_rate.num)
m_pInput->IsStreamType(DVDSTREAM_TYPE_DVD)) {
st->irFpsRate = r_frame_rate.num;
st->irFpsScale = r_frame_rate.den;
}
else
{
st->irFpsRate = 0;
st->irFpsScale = 0;
}

if (pStream->codec_info_nb_frames > 0
&& pStream->codec_info_nb_frames <= 2
&& m_pInput->IsStreamType(DVDSTREAM_TYPE_DVD))
{ {
CLog::Log(LOGDEBUG, "%s - fps may be unreliable since ffmpeg decoded only %d frame(s)", __FUNCTION__, pStream->codec_info_nb_frames); CLog::Log(LOGDEBUG, "%s - fps may be unreliable since ffmpeg decoded only %d frame(s)", __FUNCTION__, pStream->codec_info_nb_frames);
st->iFpsRate = 0; st->iFpsRate = 0;
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/VideoPlayer/DVDStreamInfo.cpp
Expand Up @@ -226,6 +226,8 @@ void CDVDStreamInfo::Assign(const CDemuxStream& right, bool withextradata)
const CDemuxStreamVideo *stream = static_cast<const CDemuxStreamVideo*>(&right); const CDemuxStreamVideo *stream = static_cast<const CDemuxStreamVideo*>(&right);
fpsscale = stream->iFpsScale; fpsscale = stream->iFpsScale;
fpsrate = stream->iFpsRate; fpsrate = stream->iFpsRate;
rfpsscale = stream->irFpsScale;
rfpsrate = stream->irFpsRate;
height = stream->iHeight; height = stream->iHeight;
width = stream->iWidth; width = stream->iWidth;
aspect = stream->fAspect; aspect = stream->fAspect;
Expand Down

0 comments on commit 8be1c65

Please sign in to comment.