Skip to content

Commit

Permalink
xvba: decoder, make sure AVFrame is initialized if FFGetBuffer fails.…
Browse files Browse the repository at this point in the history
… credits to Kelly Anderson
  • Loading branch information
FernetMenta committed Mar 6, 2012
1 parent 23423a8 commit 628f490
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp
Expand Up @@ -912,6 +912,16 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic)
CDecoder* xvba = (CDecoder*)ctx->GetHardware();
struct pictureAge* pA = &xvba->picAge;

pic->data[0] =
pic->data[1] =
pic->data[2] =
pic->data[3] = 0;

pic->linesize[0] =
pic->linesize[1] =
pic->linesize[2] =
pic->linesize[3] = 0;

CSharedLock lock(xvba->m_decoderSection);

{ CSharedLock dLock(xvba->m_displaySection);
Expand Down Expand Up @@ -974,14 +984,6 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic)
return -1;

pic->data[0] = (uint8_t*)render;
pic->data[1] =
pic->data[2] =
pic->data[3] = 0;

pic->linesize[0] =
pic->linesize[1] =
pic->linesize[2] =
pic->linesize[3] = 0;

if(pic->reference)
{
Expand Down

0 comments on commit 628f490

Please sign in to comment.