# HG changeset patch # User arpi # Date 1022711965 0 # Node ID 936aa617e8292402137a21baf0423a95947dc264 # Parent b03cdd8adb3250da0a4fee0b681c5a170410e4fe restore original bih->biCompression if codec init failed diff -r b03cdd8adb32 -r 936aa617e829 libmpcodecs/dec_video.c --- a/libmpcodecs/dec_video.c Wed May 29 22:38:34 2002 +0000 +++ b/libmpcodecs/dec_video.c Wed May 29 22:39:25 2002 +0000 @@ -135,13 +135,18 @@ } int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){ + unsigned int orig_fourcc=sh_video->bih?sh_video->bih->biCompression:0; sh_video->codec=NULL; sh_video->vf_inited=0; - while((sh_video->codec=find_codec(sh_video->format, - sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL, - sh_video->codec,0) )){ + + while(1){ + int i; + // restore original fourcc: + if(sh_video->bih) sh_video->bih->biCompression=orig_fourcc; + if(!(sh_video->codec=find_codec(sh_video->format, + sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL, + sh_video->codec,0) )) break; // ok we found one codec - int i; if(sh_video->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed if(codecname && strcmp(sh_video->codec->name,codecname)) continue; // -vc if(vfm>=0 && sh_video->codec->driver!=vfm) continue; // vfm doesn't match