summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-31 22:15:51 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-31 22:15:51 +0000
commitd5a69f4655e258e9172e0e34dbfb1910bc206b49 (patch)
tree8e1088db9e36fb5edd4d89955bd1bab53d9be2ff /libmpcodecs
parent2b9be36ccc435082a04094f00a71de1068c2287c (diff)
downloadmpv-d5a69f4655e258e9172e0e34dbfb1910bc206b49.tar.bz2
mpv-d5a69f4655e258e9172e0e34dbfb1910bc206b49.tar.xz
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
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_lzo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libmpcodecs/vd_lzo.c b/libmpcodecs/vd_lzo.c
index 59b64d84b2..379a557273 100644
--- a/libmpcodecs/vd_lzo.c
+++ b/libmpcodecs/vd_lzo.c
@@ -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,