Mercurial > mplayer.hg
comparison libmpcodecs/dec_video.c @ 6230:936aa617e829
restore original bih->biCompression if codec init failed
author | arpi |
---|---|
date | Wed, 29 May 2002 22:39:25 +0000 |
parents | 523014df7d32 |
children | a48ad140c3af |
comparison
equal
deleted
inserted
replaced
6229:b03cdd8adb32 | 6230:936aa617e829 |
---|---|
133 vf_uninit_filter_chain(sh_video->vfilter); | 133 vf_uninit_filter_chain(sh_video->vfilter); |
134 sh_video->inited=0; | 134 sh_video->inited=0; |
135 } | 135 } |
136 | 136 |
137 int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){ | 137 int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){ |
138 unsigned int orig_fourcc=sh_video->bih?sh_video->bih->biCompression:0; | |
138 sh_video->codec=NULL; | 139 sh_video->codec=NULL; |
139 sh_video->vf_inited=0; | 140 sh_video->vf_inited=0; |
140 while((sh_video->codec=find_codec(sh_video->format, | 141 |
141 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL, | 142 while(1){ |
142 sh_video->codec,0) )){ | 143 int i; |
144 // restore original fourcc: | |
145 if(sh_video->bih) sh_video->bih->biCompression=orig_fourcc; | |
146 if(!(sh_video->codec=find_codec(sh_video->format, | |
147 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL, | |
148 sh_video->codec,0) )) break; | |
143 // ok we found one codec | 149 // ok we found one codec |
144 int i; | |
145 if(sh_video->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed | 150 if(sh_video->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed |
146 if(codecname && strcmp(sh_video->codec->name,codecname)) continue; // -vc | 151 if(codecname && strcmp(sh_video->codec->name,codecname)) continue; // -vc |
147 if(vfm>=0 && sh_video->codec->driver!=vfm) continue; // vfm doesn't match | 152 if(vfm>=0 && sh_video->codec->driver!=vfm) continue; // vfm doesn't match |
148 if(sh_video->codec->status<status) continue; // too unstable | 153 if(sh_video->codec->status<status) continue; // too unstable |
149 sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it | 154 sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it |