changeset 5925:3f17793b2cea

setting vf_inited flag, some printf->mp_msg, some MSGL_FATAL->MSGL_WARN
author arpi
date Wed, 01 May 2002 17:39:46 +0000
parents 27d1f7faefd4
children 4a198a1bfa53
files libmpcodecs/dec_video.c libmpcodecs/vd.c
diffstat 2 files changed, 11 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/dec_video.c	Wed May 01 17:30:23 2002 +0000
+++ b/libmpcodecs/dec_video.c	Wed May 01 17:39:46 2002 +0000
@@ -136,6 +136,7 @@
 
 int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){
     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) )){
@@ -151,14 +152,14 @@
 	    if(mpcodecs_vd_drivers[i]->info->id==sh_video->codec->driver) break;
 	mpvdec=mpcodecs_vd_drivers[i];
 	if(!mpvdec){ // driver not available (==compiled in)
-	    mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Requested video codec family [%s] (vfm=%d) not available (enable it at compile time!)\n",
+	    mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Requested video codec family [%s] (vfm=%d) not available (enable it at compile time!)\n",
 		sh_video->codec->name, sh_video->codec->driver);
 	    continue;
 	}
 	// it's available, let's try to init!
-	printf("Opening Video Decoder: [%s] %s\n",mpvdec->info->short_name,mpvdec->info->name);
+	mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Opening Video Decoder: [%s] %s\n",mpvdec->info->short_name,mpvdec->info->name);
 	if(!mpvdec->init(sh_video)){
-	    printf("VDecoder init failed :(\n");
+	    mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDecoder init failed :(\n");
 	    continue; // try next...
 	}
 	// Yeah! We got it!
--- a/libmpcodecs/vd.c	Wed May 01 17:30:23 2002 +0000
+++ b/libmpcodecs/vd.c	Wed May 01 17:39:46 2002 +0000
@@ -137,7 +137,7 @@
     mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDec: vo config request - %d x %d, %s  \n",
 	w,h,vo_format_name(preferred_outfmt));
 
-    if(!vf) return 1; // temp hack
+//    if(!vf) return 1; // temp hack
     
     if(get_video_quality_max(sh)<=0 && divx_quality){
 	// user wants postprocess but no pp filter yet:
@@ -167,7 +167,8 @@
 	    vf=vf_open_filter(vf,"scale",NULL);
 	    goto csp_again;
 	}
-	mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_VOincompCodec);
+	mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_VOincompCodec);
+	sh->vf_inited=-1;
 	return 0;	// failed
     }
     out_fmt=sh->codec->outfmt[j];
@@ -262,19 +263,12 @@
                       fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
                       out_fmt)==0){
 //                      "MPlayer",out_fmt,&vtune)){
-	mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CannotInitVO);
-	return 0; // exit_player(MSGTR_Exit_error);
+	mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_CannotInitVO);
+	sh->vf_inited=-1;
+	return 0;
     }
 
-#if 0
-#define FREE_MPI(mpi) if(mpi){if(mpi->flags&MP_IMGFLAG_ALLOCATED) free(mpi->planes[0]); free(mpi); mpi=NULL;}
-    FREE_MPI(static_images[0])
-    FREE_MPI(static_images[1])
-    FREE_MPI(temp_images[0])
-    FREE_MPI(export_images[0])
-#undef FREE_MPI
-#endif
-
+    sh->vf_inited=1;
     return 1;
 }