Skip to content

Commit

Permalink
Revert "VideoPlayer: drop remaining rfpsscale hack"
Browse files Browse the repository at this point in the history
This reverts commit e4d743b.
  • Loading branch information
popcornmix committed Jun 16, 2016
1 parent 69d5ee5 commit 7b8e247
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 20 deletions.
11 changes: 8 additions & 3 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,12 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints)
am_private->video_ratio64 = ((int64_t)video_ratio.num << 32) | video_ratio.den;

// handle video rate
if (hints.fpsrate > 0 && hints.fpsscale != 0)
if (hints.rfpsrate > 0 && hints.rfpsscale != 0)
{
// check ffmpeg r_frame_rate 1st
am_private->video_rate = 0.5 + (float)UNIT_FREQ * hints.rfpsscale / hints.rfpsrate;
}
else if (hints.fpsrate > 0 && hints.fpsscale != 0)
{
// then ffmpeg avg_frame_rate next
am_private->video_rate = 0.5 + (float)UNIT_FREQ * hints.fpsscale / hints.fpsrate;
Expand Down Expand Up @@ -1539,8 +1544,8 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints)
CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder "
"hints.width(%d), hints.height(%d), hints.codec(%d), hints.codec_tag(%d)",
hints.width, hints.height, hints.codec, hints.codec_tag);
CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder hints.fpsrate(%d), hints.fpsscale(%d), video_rate(%d)",
hints.fpsrate, hints.fpsscale, am_private->video_rate);
CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder hints.fpsrate(%d), hints.fpsscale(%d), hints.rfpsrate(%d), hints.rfpsscale(%d), video_rate(%d)",
hints.fpsrate, hints.fpsscale, hints.rfpsrate, hints.rfpsscale, am_private->video_rate);
CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder hints.aspect(%f), video_ratio.num(%d), video_ratio.den(%d)",
hints.aspect, video_ratio.num, video_ratio.den);
CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder hints.orientation(%d), hints.forced_aspect(%d), hints.extrasize(%d)",
Expand Down
38 changes: 21 additions & 17 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option
m_mpeg2_sequence->width = m_hints.width;
m_mpeg2_sequence->height = m_hints.height;
m_mpeg2_sequence->ratio = m_hints.aspect;
if (m_hints.fpsrate > 0 && m_hints.fpsscale != 0)
if (m_hints.rfpsrate > 0 && m_hints.rfpsscale != 0)
m_mpeg2_sequence->rate = (float)m_hints.rfpsrate / m_hints.rfpsscale;
else if (m_hints.fpsrate > 0 && m_hints.fpsscale != 0)
m_mpeg2_sequence->rate = (float)m_hints.fpsrate / m_hints.fpsscale;
else
m_mpeg2_sequence->rate = 1.0;
Expand Down Expand Up @@ -440,41 +442,43 @@ void CDVDVideoCodecAmlogic::FrameRateTracking(uint8_t *pData, int iSize, double
{
default:
case 0x01:
m_hints.fpsrate = 24000.0;
m_hints.fpsscale = 1001.0;
m_hints.rfpsrate = 24000.0;
m_hints.rfpsscale = 1001.0;
break;
case 0x02:
m_hints.fpsrate = 24000.0;
m_hints.fpsscale = 1000.0;
m_hints.rfpsrate = 24000.0;
m_hints.rfpsscale = 1000.0;
break;
case 0x03:
m_hints.fpsrate = 25000.0;
m_hints.fpsscale = 1000.0;
m_hints.rfpsrate = 25000.0;
m_hints.rfpsscale = 1000.0;
break;
case 0x04:
m_hints.fpsrate = 30000.0;
m_hints.fpsscale = 1001.0;
m_hints.rfpsrate = 30000.0;
m_hints.rfpsscale = 1001.0;
break;
case 0x05:
m_hints.fpsrate = 30000.0;
m_hints.fpsscale = 1000.0;
m_hints.rfpsrate = 30000.0;
m_hints.rfpsscale = 1000.0;
break;
case 0x06:
m_hints.fpsrate = 50000.0;
m_hints.fpsscale = 1000.0;
m_hints.rfpsrate = 50000.0;
m_hints.rfpsscale = 1000.0;
break;
case 0x07:
m_hints.fpsrate = 60000.0;
m_hints.fpsscale = 1001.0;
m_hints.rfpsrate = 60000.0;
m_hints.rfpsscale = 1001.0;
break;
case 0x08:
m_hints.fpsrate = 60000.0;
m_hints.fpsscale = 1000.0;
m_hints.rfpsrate = 60000.0;
m_hints.rfpsscale = 1000.0;
break;
}
m_hints.width = m_mpeg2_sequence->width;
m_hints.height = m_mpeg2_sequence->height;
m_hints.aspect = m_mpeg2_sequence->ratio;
m_hints.fpsrate = m_hints.rfpsrate;
m_hints.fpsscale = m_hints.rfpsscale;
}
return;
}
Expand Down
6 changes: 6 additions & 0 deletions xbmc/cores/VideoPlayer/DVDStreamInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ void CDVDStreamInfo::Clear()

fpsscale = 0;
fpsrate = 0;
rfpsscale= 0;
rfpsrate = 0;
height = 0;
width = 0;
aspect = 0.0;
Expand Down Expand Up @@ -99,6 +101,8 @@ bool CDVDStreamInfo::Equal(const CDVDStreamInfo& right, bool withextradata)
// VIDEO
if( fpsscale != right.fpsscale
|| fpsrate != right.fpsrate
|| rfpsscale!= right.rfpsscale
|| rfpsrate != right.rfpsrate
|| height != right.height
|| width != right.width
|| stills != right.stills
Expand Down Expand Up @@ -163,6 +167,8 @@ void CDVDStreamInfo::Assign(const CDVDStreamInfo& right, bool withextradata)
// VIDEO
fpsscale = right.fpsscale;
fpsrate = right.fpsrate;
rfpsscale= right.rfpsscale;
rfpsrate = right.rfpsrate;
height = right.height;
width = right.width;
aspect = right.aspect;
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/VideoPlayer/DVDStreamInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class CDVDStreamInfo
// VIDEO
int fpsscale; // scale of 1001 and a rate of 60000 will result in 59.94 fps
int fpsrate;
int rfpsscale;
int rfpsrate;
int height; // height of the stream reported by the demuxer
int width; // width of the stream reported by the demuxer
float aspect; // display aspect as reported by demuxer
Expand Down

0 comments on commit 7b8e247

Please sign in to comment.