Skip to content

Commit

Permalink
xbva, vdpau: cleanup textures properly, fixes playback of unsopported…
Browse files Browse the repository at this point in the history
… codecs after hw acceleration
  • Loading branch information
FernetMenta committed Mar 18, 2012
1 parent ac95615 commit 1a71873
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2274,12 +2274,14 @@ void CLinuxRendererGL::DeleteVDPAUTexture(int index)
{
#ifdef HAVE_LIBVDPAU
YUVPLANE &plane = m_buffers[index].fields[0][0];
YUVFIELDS &fields = m_buffers[index].fields;

SAFE_RELEASE(m_buffers[index].vdpau);

if(plane.id && glIsTexture(plane.id))
glDeleteTextures(1, &plane.id);
plane.id = 0;
fields[0][1].id = 0;
#endif
}

Expand Down Expand Up @@ -2339,12 +2341,17 @@ void CLinuxRendererGL::DeleteVDPAUTexture420(int index)
{
#ifdef HAVE_LIBVDPAU
YUVPLANE &plane = m_buffers[index].fields[0][0];
YUVFIELDS &fields = m_buffers[index].fields;

SAFE_RELEASE(m_buffers[index].vdpau);

if(plane.id && glIsTexture(plane.id))
glDeleteTextures(1, &plane.id);
plane.id = 0;
fields[1][0].id = 0;
fields[1][1].id = 0;
fields[2][0].id = 0;
fields[2][1].id = 0;

#endif
}
Expand Down Expand Up @@ -2611,12 +2618,14 @@ void CLinuxRendererGL::DeleteXVBATexture(int index)
{
#ifdef HAVE_LIBXVBA
YUVPLANE &plane = m_buffers[index].fields[0][0];
YUVFIELDS &fields = m_buffers[index].fields;

SAFE_RELEASE(m_buffers[index].xvba);

if(plane.id && glIsTexture(plane.id))
glDeleteTextures(1, &plane.id);
plane.id = 0;
fields[0][1].id = 0;
#endif
}

Expand Down

0 comments on commit 1a71873

Please sign in to comment.