[Mplayer-cvslog] CVS: main/libmpcodecs dec_video.c,1.136,1.137

Arpi of Ize arpi at mplayerhq.hu
Thu May 30 00:39:27 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv13979

Modified Files:
	dec_video.c 
Log Message:
restore original bih->biCompression if codec init failed


Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -r1.136 -r1.137
--- dec_video.c	20 May 2002 03:25:23 -0000	1.136
+++ dec_video.c	29 May 2002 22:39:25 -0000	1.137
@@ -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) )){
-	// ok we found one codec
+
+    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
 	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




More information about the MPlayer-cvslog mailing list