[Mplayer-cvslog] CVS: main cfg-common.h,1.55,1.56 codec-cfg.c,1.92,1.93 codec-cfg.h,1.62,1.63 help_mp-en.h,1.48,1.49 mencoder.c,1.151,1.152 mplayer.c,1.555,1.556 mplayer.h,1.14,1.15

Arpi of Ize arpi at mplayerhq.hu
Fri Aug 30 23:44:22 CEST 2002


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

Modified Files:
	cfg-common.h codec-cfg.c codec-cfg.h help_mp-en.h mencoder.c 
	mplayer.c mplayer.h 
Log Message:
-afm/-vfm migration from ID (int) to NAME (string) - simplifies code and makes dlopen()'ing possible


Index: cfg-common.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-common.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- cfg-common.h	30 Aug 2002 11:37:40 -0000	1.55
+++ cfg-common.h	30 Aug 2002 21:44:04 -0000	1.56
@@ -104,8 +104,10 @@
 	{"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0, NULL},
 
 	// select audio/video codec (by name) or codec family (by number):
-	{"afm", &audio_family, CONF_TYPE_INT, CONF_MIN, 0, 22, NULL}, // keep ranges in sync
-	{"vfm", &video_family, CONF_TYPE_INT, CONF_MIN, 0, 29, NULL}, // with codec-cfg.c
+//	{"afm", &audio_family, CONF_TYPE_INT, CONF_MIN, 0, 22, NULL}, // keep ranges in sync
+//	{"vfm", &video_family, CONF_TYPE_INT, CONF_MIN, 0, 29, NULL}, // with codec-cfg.c
+	{"afm", &audio_fm, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"vfm", &video_fm, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{"ac", &audio_codec, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{"vc", &video_codec, CONF_TYPE_STRING, 0, 0, 0, NULL},
 

Index: codec-cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- codec-cfg.c	5 Aug 2002 17:23:22 -0000	1.92
+++ codec-cfg.c	30 Aug 2002 21:44:04 -0000	1.93
@@ -210,6 +210,7 @@
 	return 0;
 }
 
+#if 0
 static short get_driver(char *s,int audioflag)
 {
 	static char *audiodrv[] = {
@@ -278,6 +279,7 @@
 
 	return -1;
 }
+#endif
 
 static int validate_codec(codecs_t *c, int type)
 {
@@ -581,8 +583,10 @@
 		} else if (!strcmp(token[0], "driver")) {
 			if (get_token(1, 1) < 0)
 				goto err_out_parse_error;
-			if ((codec->driver = get_driver(token[0],codec_type))<0)
-				goto err_out_parse_error;
+			if (!(codec->drv = strdup(token[0]))) {
+				mp_msg(MSGT_CODECCFG,MSGL_ERR,"can't strdup -> 'driver': %s\n", strerror(errno));
+				goto err_out;
+			}
 		} else if (!strcmp(token[0], "dll")) {
 			if (get_token(1, 1) < 0)
 				goto err_out_parse_error;
@@ -651,11 +655,6 @@
 				goto err_out_parse_error;
 			if (!(codec->cpuflags = get_cpuflags(token[0])))
 				goto err_out_parse_error;
-    } else if (!strcasecmp(token[0], "priority")) {
-			if (get_token(1, 1) < 0)
-				goto err_out_parse_error;
-      //printf("\n\n!!!cfg-parse: priority %s (%d) found!!!\n\n", token[0], atoi(token[0])); // ::atmos
-      codec->priority = atoi(token[0]);
 		} else
 			goto err_out_parse_error;
 	}
@@ -738,7 +737,8 @@
 		for (/* NOTHING */; i--; c++) {
                         if(start && c<=start) continue;
 			for (j = 0; j < CODECS_MAX_FOURCC; j++) {
-				if (c->fourcc[j]==fourcc || c->driver==0) {
+				// FIXME: do NOT hardwire 'null' name here:
+				if (c->fourcc[j]==fourcc || !strcmp(c->drv,"null")) {
 					if (fourccmap)
 						*fourccmap = c->fourccmap[j];
 					return c;
@@ -787,9 +787,9 @@
 			  case CODECS_STATUS_UNTESTED:    s="untested";break;
 			}
 			if(c->dll)
-			  mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s%2d  %s  %s  [%s]\n",c->name,c->driver,s,c->info,c->dll);
+			  mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-6s  %s  %s  [%s]\n",c->name,c->drv,s,c->info,c->dll);
 			else
-			  mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s%2d  %s  %s\n",c->name,c->driver,s,c->info);
+			  mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-6s  %s  %s\n",c->name,c->drv,s,c->info);
 			
 		}
 

Index: codec-cfg.h
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- codec-cfg.h	5 Aug 2002 21:02:23 -0000	1.62
+++ codec-cfg.h	30 Aug 2002 21:44:04 -0000	1.63
@@ -26,59 +26,6 @@
 #define CODECS_STATUS_UNTESTED		2
 #define CODECS_STATUS__MAX		2
 
-// Codec family/driver:
-#define AFM_MPEG 1
-#define AFM_PCM 2
-#define AFM_AC3 3
-#define AFM_ACM 4
-#define AFM_ALAW 5
-#define AFM_GSM 6
-#define AFM_DSHOW 7
-#define AFM_DVDPCM 8
-#define AFM_HWAC3 9
-#define AFM_VORBIS 10
-#define AFM_FFMPEG 11
-#define AFM_MAD 12
-#define AFM_MSADPCM 13
-#define AFM_A52 14
-#define AFM_G72X 15
-#define AFM_IMAADPCM 16
-#define AFM_DK4ADPCM 17
-#define AFM_DK3ADPCM 18
-#define AFM_ROQAUDIO 19
-#define AFM_AAC 20
-#define AFM_REAL 21
-#define AFM_LIBDV 22
-
-#define VFM_MPEG 1
-#define VFM_VFW 2
-#define VFM_ODIVX 3
-#define VFM_DSHOW 4
-#define VFM_FFMPEG 5
-#define VFM_VFWEX 6
-#define VFM_DIVX4 7
-#define VFM_RAW 8
-#define VFM_MSRLE 9
-#define VFM_XANIM 10
-#define VFM_MSVIDC 11
-#define VFM_FLI 12
-#define VFM_CINEPAK 13
-#define VFM_QTRLE 14
-#define VFM_NUV 15
-#define VFM_CYUV 16
-#define VFM_QTSMC 17
-#define VFM_DUCKTM1 18
-#define VFM_ROQVIDEO 19
-#define VFM_QTRPZA 20
-#define VFM_MPNG 21
-#define VFM_IJPG 22
-#define VFM_HUFFYUV 23
-#define VFM_ZLIB 24
-#define VFM_MPEGPES 25
-#define VFM_REAL 26
-#define VFM_SVQ1 27
-#define VFM_XVID 28
-#define VFM_LIBDV 29
 
 #ifndef GUID_TYPE
 #define GUID_TYPE
@@ -102,12 +49,12 @@
 	char *info;
 	char *comment;
 	char *dll;
+	char* drv;
 	GUID guid;
-	short driver;
+//	short driver;
 	short flags;
 	short status;
 	short cpuflags;
-  short priority;
 } codecs_t;
 
 int parse_codec_cfg(char *cfgfile);

Index: help_mp-en.h
===================================================================
RCS file: /cvsroot/mplayer/main/help_mp-en.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- help_mp-en.h	30 Aug 2002 19:10:46 -0000	1.48
+++ help_mp-en.h	30 Aug 2002 21:44:04 -0000	1.49
@@ -85,12 +85,12 @@
 #define MSGTR_CoreDumped "core dumped :)\n"
 #define MSGTR_FPSnotspecified "FPS not specified (or invalid) in the header! Use the -fps option!\n"
 #define MSGTR_NoVideoStream "Sorry, no video stream... it's unplayable yet\n"
-#define MSGTR_TryForceAudioFmt "Trying to force audio codec driver family %d ...\n"
+#define MSGTR_TryForceAudioFmtStr "Trying to force audio codec driver family %s ...\n"
 #define MSGTR_CantFindAfmtFallback "Can't find audio codec for forced driver family, fallback to other drivers.\n"
 #define MSGTR_CantFindAudioCodec "Can't find codec for audio format 0x%X !\n"
 #define MSGTR_TryUpgradeCodecsConfOrRTFM "*** Try to upgrade %s from etc/codecs.conf\n*** If it's still not OK, then read DOCS/codecs.html!\n"
 #define MSGTR_CouldntInitAudioCodec "Couldn't initialize audio codec! -> nosound\n"
-#define MSGTR_TryForceVideoFmt "Trying to force video codec driver family %d ...\n"
+#define MSGTR_TryForceVideoFmtStr "Trying to force video codec driver family %s ...\n"
 #define MSGTR_CantFindVfmtFallback "Can't find video codec for forced driver family, fallback to other drivers.\n"
 #define MSGTR_CantFindVideoCodec "Can't find codec matching selected -vo and video format 0x%X !\n"
 #define MSGTR_VOincompCodec "Sorry, selected video_out device is incompatible with this codec.\n"
@@ -286,12 +286,12 @@
 #define MSGTR_UsingExternalPP "[PP] Using external postprocessing filter, max q = %d\n"
 #define MSGTR_UsingCodecPP "[PP] Using codec's postprocessing, max q = %d\n"
 #define MSGTR_VideoAttributeNotSupportedByVO_VD "Video attribute '%s' isn't supported by selected vo & vd! \n"
-#define MSGTR_VideoCodecFamilyNotAvailable "Requested video codec family [%s] (vfm=%d) not available (enable it at compile time!)\n"
-#define MSGTR_AudioCodecFamilyNotAvailable "Requested audio codec family [%s] (afm=%d) not available (enable it at compile time!)\n"
+#define MSGTR_VideoCodecFamilyNotAvailableStr "Requested video codec family [%s] (vfm=%s) not available (enable it at compile time!)\n"
+#define MSGTR_AudioCodecFamilyNotAvailableStr "Requested audio codec family [%s] (afm=%s) not available (enable it at compile time!)\n"
 #define MSGTR_OpeningVideoDecoder "Opening video decoder: [%s] %s\n"
 #define MSGTR_OpeningAudioDecoder "Opening audio decoder: [%s] %s\n"
-#define MSGTR_UninitVideo "uninit video: %d  \n"
-#define MSGTR_UninitAudio "uninit audio: %d  \n"
+#define MSGTR_UninitVideoStr "uninit video: %s  \n"
+#define MSGTR_UninitAudioStr "uninit audio: %s  \n"
 #define MSGTR_VDecoderInitFailed "VDecoder init failed :(\n"
 #define MSGTR_ADecoderInitFailed "ADecoder init failed :(\n"
 #define MSGTR_ADecoderPreinitFailed "ADecoder preinit failed :(\n"

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -r1.151 -r1.152
--- mencoder.c	29 Aug 2002 20:50:48 -0000	1.151
+++ mencoder.c	30 Aug 2002 21:44:04 -0000	1.152
@@ -87,8 +87,8 @@
 static int has_audio=1;
 char *audio_codec=NULL; // override audio codec
 char *video_codec=NULL; // override video codec
-int audio_family=-1;     // override audio codec family 
-int video_family=-1;     // override video codec family 
+char* audio_fm=NULL;     // override audio codec family 
+char* video_fm=NULL;     // override video codec family 
 
 // libvo opts: (defiend at libmpcodecs/vd.c)
 extern int screen_size_xy;
@@ -488,14 +488,14 @@
 if(sh_audio && (out_audio_codec || seek_to_sec || !sh_audio->wf)){
   // Go through the codec.conf and find the best codec...
   sh_audio->codec=NULL;
-  if(audio_family!=-1) mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_TryForceAudioFmt,audio_family);
+  if(audio_fm) mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_TryForceAudioFmtStr,audio_fm);
   while(1){
     sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1);
     if(!sh_audio->codec){
-      if(audio_family!=-1) {
+      if(audio_fm) {
         sh_audio->codec=NULL; /* re-search */
         mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantFindAfmtFallback);
-        audio_family=-1;
+        audio_fm=NULL;
         continue;      
       }
       mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantFindAudioCodec,sh_audio->format);
@@ -504,8 +504,8 @@
       break;
     }
     if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue;
-    else if(audio_family!=-1 && sh_audio->codec->driver!=audio_family) continue;
-    mp_msg(MSGT_MENCODER,MSGL_INFO,"%s audio codec: [%s] drv:%d (%s)\n",audio_codec?"Forcing":"Detected",sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info);
+    else if(audio_fm && strcmp(sh_audio->codec->drv,audio_fm)) continue;
+    mp_msg(MSGT_MENCODER,MSGL_INFO,"%s audio codec: [%s] afm:%s (%s)\n",audio_codec?"Forcing":"Detected",sh_audio->codec->name,sh_audio->codec->drv,sh_audio->codec->info);
     break;
   }
 }
@@ -670,11 +670,11 @@
 } else {
     int status;
     // try in stability order: UNTESTED, WORKING, BUGGY, BROKEN
-    if(video_family>=0) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmt,video_family);
+    if(video_fm) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmtStr,video_fm);
     for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status){
-	if(video_family>=0) // try first the preferred codec family:
-	    if(init_video(sh_video,NULL,video_family,status)) break;
-	if(init_video(sh_video,NULL,-1,status)) break;
+	if(video_fm) // try first the preferred codec family:
+	    if(init_video(sh_video,NULL,video_fm,status)) break;
+	if(init_video(sh_video,NULL,NULL,status)) break;
     }
 }
 if(!sh_video->inited){
@@ -682,8 +682,8 @@
     mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
     mencoder_exit(1,NULL);
 }
-mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s video codec: [%s] drv:%d (%s)\n",
-    video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->driver,sh_video->codec->info);
+mp_msg(MSGT_CPLAYER,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_CPLAYER,MSGL_INFO,"==========================================================================\n");
 
 }

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.555
retrieving revision 1.556
diff -u -r1.555 -r1.556
--- mplayer.c	29 Aug 2002 22:24:45 -0000	1.555
+++ mplayer.c	30 Aug 2002 21:44:04 -0000	1.556
@@ -176,8 +176,8 @@
 int has_video=1;
 char *audio_codec=NULL; // override audio codec
 char *video_codec=NULL; // override video codec
-int audio_family=-1;     // override audio codec family 
-int video_family=-1;     // override video codec family 
+char *audio_fm=NULL;    // override audio codec family 
+char *video_fm=NULL;    // override video codec family 
 
 // IMHO this stuff is no longer of use, or is there a special
 // reason why dshow should be completely disabled? - atmos ::
@@ -1201,15 +1201,15 @@
 if(sh_audio){
   // Go through the codec.conf and find the best codec...
   sh_audio->codec=NULL;
-  if(audio_family!=-1) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceAudioFmt,audio_family);
+  if(audio_fm) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceAudioFmtStr,audio_fm);
   while(1){
     sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1);
     if(!sh_audio->codec){
-      if(audio_family!=-1) {
+      if(audio_fm) {
         sh_audio->codec=NULL; /* re-search */
         mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindAfmtFallback);
-        audio_family=-1;
-        continue;      
+        audio_fm=NULL;
+        continue;
       }
       mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindAudioCodec,sh_audio->format);
       mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
@@ -1217,9 +1217,9 @@
       break;
     }
     if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue;
-    else if(audio_family!=-1 && sh_audio->codec->driver!=audio_family) continue;
-    mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s audio codec: [%s] afm:%d (%s)\n",
-	audio_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info);
+    else if(audio_fm && strcmp(sh_audio->codec->drv,audio_fm)) continue;
+    mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s audio codec: [%s] afm:%s (%s)\n",
+	audio_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_audio->codec->name,sh_audio->codec->drv,sh_audio->codec->info);
     break;
   }
 }
@@ -1275,11 +1275,11 @@
 } else {
     int status;
     // try in stability order: UNTESTED, WORKING, BUGGY, BROKEN
-    if(video_family>=0) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmt,video_family);
+    if(video_fm) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmtStr,video_fm);
     for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status){
-	if(video_family>=0) // try first the preferred codec family:
-	    if(init_video(sh_video,NULL,video_family,status)) break;
-	if(init_video(sh_video,NULL,-1,status)) break;
+	if(video_fm) // try first the preferred codec family:
+	    if(init_video(sh_video,NULL,video_fm,status)) break;
+	if(init_video(sh_video,NULL,NULL,status)) break;
     }
 }
 if(!sh_video->inited){
@@ -1291,8 +1291,8 @@
     goto main; // exit_player(MSGTR_Exit_error);
 }
 
-mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s video codec: [%s] vfm:%d (%s)\n",
-    video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->driver,sh_video->codec->info);
+mp_msg(MSGT_CPLAYER,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_CPLAYER,MSGL_INFO,"==========================================================================\n");
 
 if(auto_quality>0){

Index: mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- mplayer.h	29 Aug 2002 22:24:45 -0000	1.14
+++ mplayer.h	30 Aug 2002 21:44:04 -0000	1.15
@@ -10,7 +10,7 @@
 extern int fullscreen;
 extern int vcd_track;
 
-extern int    video_family;
+//extern int    video_family; // OBSOLETE, use video_fm
 extern char * video_driver;
 extern char * audio_driver;
 extern int    has_audio;




More information about the MPlayer-cvslog mailing list