Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

vdpau: fix starvation whan draining

  • Loading branch information...
commit faedfe9d7474ab10eb9c283d2e85617ab4dd85e7 1 parent d30e904
@FernetMenta authored
View
26 xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
@@ -989,27 +989,31 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame, bool bSoftDrain, bo
msg->Release();
}
- if (decoded + processed + render < 6)
+ if ((m_codecControl & DVP_FLAG_DRAIN))
{
- retval |= VC_BUFFER;
+ if (decoded + processed + render < 4)
+ {
+ retval |= VC_BUFFER;
+ }
+ }
+ else
+ {
+ if (decoded + processed + render < 6)
+ {
+ retval |= VC_BUFFER;
+ }
}
- bool bWait = !retval;
- if ((m_codecControl & DVP_FLAG_DRAIN)
- && (decoded + processed + render > 2)
- && !(retval & VC_PICTURE))
- bWait = true;
-
- if (bWait && !m_inMsgEvent.WaitMSec(2000))
+ if (!retval && !m_inMsgEvent.WaitMSec(2000))
break;
}
uint64_t diff = CurrentHostCounter() - startTime;
if (retval & VC_PICTURE)
{
m_bufferStats.SetParams(diff, m_speed);
- if (diff*1000/CurrentHostFrequency() > 50)
- CLog::Log(LOGDEBUG,"CVDPAU::Decode long wait: %d", (int)((diff*1000)/CurrentHostFrequency()));
}
+ if (diff*1000/CurrentHostFrequency() > 50)
+ CLog::Log(LOGDEBUG,"CVDPAU::Decode long wait: %d", (int)((diff*1000)/CurrentHostFrequency()));
if (!retval)
{
View
6 xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
@@ -1723,18 +1723,18 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts)
// if lateness is smaller than frametime, we observe this state
// for 10 cycles
- if (m_droppingStats.m_lateFrames > 10 || iLateness < -1/m_fFrameRate)
+ if (m_droppingStats.m_lateFrames > 10 || iLateness < -2/m_fFrameRate)
{
// is frame allowed to skip
if (m_iNrOfPicturesNotToSkip <= 0)
{
result |= EOS_LATE;
- if (iLateness < -2/m_fFrameRate)
+ if (iLateness < -3/m_fFrameRate)
result |= EOS_VERYLATE;
// drop in output
- if (m_droppingStats.m_dropRequests > 5 && g_graphicsContext.IsFullScreenVideo())
+ if (m_droppingStats.m_dropRequests > 7 && g_graphicsContext.IsFullScreenVideo())
{
m_droppingStats.m_dropRequests--; //decrease so we only drop half the frames
m_droppingStats.m_requestOutputDrop = true;
Please sign in to comment.
Something went wrong with that request. Please try again.