Browse files

xvba: correct order in clear down of gl resources

  • Loading branch information...
1 parent 84075fd commit 2f8921af82dcaf407e2d68954dba7f86e5a1d7c5 @FernetMenta committed Mar 6, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp
View
12 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp
@@ -1387,12 +1387,6 @@ void CDecoder::FinishGL()
for (unsigned int j=0; j<3; ++j)
{
- if (glIsTexture(m_flipBuffer[i].glTexture[j]))
- {
- glDeleteTextures(1, &m_flipBuffer[i].glTexture[j]);
- m_flipBuffer[i].glTexture[j] = 0;
- CLog::Log(LOGDEBUG, "XVBA::FinishGL - destroyed texture, index: %d, field %d", i, j);
- }
if (m_flipBuffer[i].glSurface[j] && m_xvbaSession)
{
{ CSingleLock lock(m_apiSec);
@@ -1401,6 +1395,12 @@ void CDecoder::FinishGL()
m_flipBuffer[i].glSurface[j] = 0;
CLog::Log(LOGDEBUG, "XVBA::FinishGL - destroyed shared surface");
}
+ if (glIsTexture(m_flipBuffer[i].glTexture[j]))
+ {
+ glDeleteTextures(1, &m_flipBuffer[i].glTexture[j]);
+ m_flipBuffer[i].glTexture[j] = 0;
+ CLog::Log(LOGDEBUG, "XVBA::FinishGL - destroyed texture, index: %d, field %d", i, j);
+ }
}
}
}

1 comment on commit 2f8921a

@fritsch

If I see this right, it just changes the order of freeing the resources.
Did DestroySurface return BadSurface if you deleted the texture before with glDeleteTexture?

Please sign in to comment.