Avoid a static variable and instead use variable in context

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22095 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-01-31 22:15:51 +00:00
parent 2b9be36ccc
commit d5a69f4655
1 changed files with 5 additions and 4 deletions

View File

@ -91,7 +91,6 @@ static void uninit(sh_video_t *sh)
// decode a frame
static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
{
static int init_done = 0;
int r;
mp_image_t* mpi;
int w;
@ -102,7 +101,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
}
if (!init_done) {
if (priv->codec == -1) {
lzo_byte *tmp = lzo_malloc(sh->bih->biSizeImage);
// decompress one frame to see if its
@ -135,8 +134,10 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
return NULL;
}
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,priv->codec)) return NULL;
init_done++;
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,priv->codec)) {
priv->codec = -1;
return NULL;
}
}
mpi = mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, 0,