Permalink
Browse files

vdpau: fix potential leak of output surface

  • Loading branch information...
1 parent f9f3d2a commit c2eb3353fc3644ac4325dac9540a383a18ac35b5 @FernetMenta committed with Mar 22, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
  2. +0 −1 xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
@@ -1340,6 +1340,7 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg)
m_extTimeout = 1000;
return;
}
+ m_outputSurfaces.pop();
m_config.stats->IncProcessed();
m_dataPort.SendInMessage(CMixerDataProtocol::PICTURE,&m_processPicture,sizeof(m_processPicture));
if (m_mixersteps > 1)
@@ -1391,7 +1392,6 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg)
{
case CMixerControlProtocol::TIMEOUT:
m_processPicture.outputSurface = m_outputSurfaces.front();
- m_outputSurfaces.pop();
m_mixerstep = 1;
ProcessPicture();
if (m_vdpError)
@@ -1400,6 +1400,7 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg)
m_extTimeout = 1000;
return;
}
+ m_outputSurfaces.pop();
m_config.stats->IncProcessed();
m_dataPort.SendInMessage(CMixerDataProtocol::PICTURE,&m_processPicture,sizeof(m_processPicture));
FiniCycle();
@@ -2198,7 +2199,6 @@ void CMixer::InitCycle()
if (m_mixerInput[1].DVDPic.format == DVDVideoPicture::FMT_VDPAU)
{
m_processPicture.outputSurface = m_outputSurfaces.front();
- m_outputSurfaces.pop();
m_mixerInput[1].DVDPic.iWidth = m_config.outWidth;
m_mixerInput[1].DVDPic.iHeight = m_config.outHeight;
}
@@ -2210,7 +2210,6 @@ void CMixer::InitCycle()
m_processPicture.DVDPic = m_mixerInput[1].DVDPic;
m_processPicture.render = m_mixerInput[1].render;
- m_processPicture.numDecodedPics = m_decodedPics.size();
}
void CMixer::FiniCycle()
@@ -206,7 +206,6 @@ struct CVdpauProcessedPicture
DVDVideoPicture DVDPic;
vdpau_render_state *render;
VdpOutputSurface outputSurface;
- uint8_t numDecodedPics;
};
/**

0 comments on commit c2eb335

Please sign in to comment.