[Mplayer-cvslog] CVS: main/libmpcodecs dec_video.c,1.151,1.152 dec_video.h,1.12,1.13

Arpi of Ize arpi at mplayerhq.hu
Thu Sep 26 03:31:21 CEST 2002


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

Modified Files:
	dec_video.c dec_video.h 
Log Message:
-vc/-vfm accepts codec/driver _list_ now. empty list element for -vc means
*, ie search all codecs. codec name starting with - disables the codec.


Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -r1.151 -r1.152
--- dec_video.c	25 Sep 2002 23:45:34 -0000	1.151
+++ dec_video.c	26 Sep 2002 01:31:18 -0000	1.152
@@ -204,26 +204,41 @@
     return 0;
 }
 
-int init_best_video_codec(sh_video_t *sh_video,char* video_codec,char* video_fm){
+int init_best_video_codec(sh_video_t *sh_video,char** video_codec_list,char** video_fm_list){
+char* vc_l_default[2]={"",(char*)NULL};
+// hack:
+if(!video_codec_list) video_codec_list=vc_l_default;
 // Go through the codec.conf and find the best codec...
 sh_video->inited=0;
 codecs_reset_selection(0);
-if(video_codec){
-    // forced codec by name:
-    mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec);
-    init_video(sh_video,video_codec,NULL,-1);
-} else {
+while(!sh_video->inited && *video_codec_list){
+  char* video_codec=*(video_codec_list++);
+  if(video_codec[0]){
+    if(video_codec[0]=='-'){
+      // disable this codec:
+      select_codec(video_codec+1,0);
+    } else {
+      // forced codec by name:
+      mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec);
+      init_video(sh_video,video_codec,NULL,-1);
+    }
+  } else {
     int status;
     // try in stability order: UNTESTED, WORKING, BUGGY. never try CRASHING.
-    if(video_fm){
-	// try first the preferred codec family:
+    if(video_fm_list){
+      char** fmlist=video_fm_list;
+      // try first the preferred codec families:
+      while(!sh_video->inited && *fmlist){
+        char* video_fm=*(fmlist++);
 	mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_TryForceVideoFmtStr,video_fm);
 	for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status)
 	    if(init_video(sh_video,NULL,video_fm,status)) break;
+      }
     }
     if(!sh_video->inited)
 	for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status)
 	    if(init_video(sh_video,NULL,NULL,status)) break;
+  }
 }
 
 if(!sh_video->inited){
@@ -232,8 +247,8 @@
     return 0; // failed
 }
 
-mp_msg(MSGT_DECVIDEO,MSGL_INFO,"%s video codec: [%s] vfm:%s (%s)\n",
-    video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->drv,sh_video->codec->info);
+mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Selected video codec: [%s] vfm:%s (%s)\n",
+    sh_video->codec->name,sh_video->codec->drv,sh_video->codec->info);
 return 1; // success
 }
 

Index: dec_video.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- dec_video.h	25 Sep 2002 23:45:34 -0000	1.12
+++ dec_video.h	26 Sep 2002 01:31:18 -0000	1.13
@@ -4,7 +4,7 @@
 
 extern void vfm_help();
 
-extern int init_best_video_codec(sh_video_t *sh_video,char* video_codec,char* video_fm);
+extern int init_best_video_codec(sh_video_t *sh_video,char** video_codec_list,char** video_fm_list);
 
 //extern int init_video(sh_video_t *sh_video, int *pitches);
 extern int init_video(sh_video_t *sh_video,char* codecname,char* vfm,int status);




More information about the MPlayer-cvslog mailing list