Skip to content
Permalink
Browse files

Revert "VideoPlayer: drop obsolete irFpsScale"

This reverts commit 51ebe16.
  • Loading branch information...
popcornmix committed Jun 11, 2016
1 parent b156cad commit 8be1c65b17c83adae8550f4704affd01ab5a181a
@@ -148,6 +148,8 @@ class CDemuxStreamVideo : public CDemuxStream
{
iFpsScale = 0;
iFpsRate = 0;
irFpsScale = 0;
irFpsRate = 0;
iHeight = 0;
iWidth = 0;
fAspect = 0.0;
@@ -163,6 +165,8 @@ class CDemuxStreamVideo : public CDemuxStream
virtual ~CDemuxStreamVideo() {}
int iFpsScale; // scale of 1000 and a rate of 29970 will result in 29.97 fps
int iFpsRate;
int irFpsScale;
int irFpsRate;
int iHeight; // height of the stream reported by the demuxer
int iWidth; // width of the stream reported by the demuxer
float fAspect; // display aspect of stream
@@ -418,6 +418,8 @@ void CDVDDemuxClient::RequestStreams()

streamVideo->iFpsScale = source->iFpsScale;
streamVideo->iFpsRate = source->iFpsRate;
streamVideo->irFpsScale = source->irFpsScale;
streamVideo->irFpsRate = source->irFpsRate;
streamVideo->iHeight = source->iHeight;
streamVideo->iWidth = source->iWidth;
streamVideo->fAspect = source->fAspect;
@@ -1279,9 +1279,21 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx)
st->iFpsScale = 0;
}

if (pStream->codec_info_nb_frames > 0 &&
pStream->codec_info_nb_frames <= 2 &&
m_pInput->IsStreamType(DVDSTREAM_TYPE_DVD))
// added for aml hw decoder, mkv frame-rate can be wrong.
if (r_frame_rate.den && r_frame_rate.num)
{
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);
st->iFpsRate = 0;
@@ -226,6 +226,8 @@ void CDVDStreamInfo::Assign(const CDemuxStream& right, bool withextradata)
const CDemuxStreamVideo *stream = static_cast<const CDemuxStreamVideo*>(&right);
fpsscale = stream->iFpsScale;
fpsrate = stream->iFpsRate;
rfpsscale = stream->irFpsScale;
rfpsrate = stream->irFpsRate;
height = stream->iHeight;
width = stream->iWidth;
aspect = stream->fAspect;

0 comments on commit 8be1c65

Please sign in to comment.
You can’t perform that action at this time.