[MPlayer-cvslog] CVS: main/libmpcodecs dec_audio.c, 1.43, 1.44 dec_video.c, 1.161, 1.162

Reimar Döffinger CVS syncmail at mplayerhq.hu
Wed Aug 31 01:56:26 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv23706/libmpcodecs

Modified Files:
	dec_audio.c dec_video.c 
Log Message:
Allow forcing of demuxers and codecs by prepending '+'


Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_audio.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- dec_audio.c	25 Aug 2005 18:22:12 -0000	1.43
+++ dec_audio.c	30 Aug 2005 23:56:23 -0000	1.44
@@ -119,6 +119,11 @@
 
 int init_audio(sh_audio_t *sh_audio,char* codecname,char* afm,int status){
     unsigned int orig_fourcc=sh_audio->wf?sh_audio->wf->wFormatTag:0;
+    int force = 0;
+    if (codecname && codecname[0] == '+') {
+      codecname = &codecname[1];
+      force = 1;
+    }
     sh_audio->codec=NULL;
     while(1){
 	ad_functions_t* mpadec;
@@ -126,14 +131,14 @@
 	sh_audio->ad_driver = 0;
 	// restore original fourcc:
 	if(sh_audio->wf) sh_audio->wf->wFormatTag=i=orig_fourcc;
-	if(!(sh_audio->codec=find_codec(sh_audio->format,
-          sh_audio->wf?(&i):NULL, sh_audio->codec,1) )) break;
+	if(!(sh_audio->codec=find_audio_codec(sh_audio->format,
+          sh_audio->wf?(&i):NULL, sh_audio->codec, force) )) break;
 	if(sh_audio->wf) sh_audio->wf->wFormatTag=i;
 	// ok we found one codec
 	if(sh_audio->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed
 	if(codecname && strcmp(sh_audio->codec->name,codecname)) continue; // -ac
 	if(afm && strcmp(sh_audio->codec->drv,afm)) continue; // afm doesn't match
-	if(sh_audio->codec->status<status) continue; // too unstable
+	if(!force && sh_audio->codec->status<status) continue; // too unstable
 	sh_audio->codec->flags|=CODECS_FLAG_SELECTED; // tagging it
 	// ok, it matches all rules, let's find the driver!
 	for (i=0; mpcodecs_ad_drivers[i] != NULL; i++)

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -r1.161 -r1.162
--- dec_video.c	20 Jun 2005 23:07:35 -0000	1.161
+++ dec_video.c	30 Aug 2005 23:56:23 -0000	1.162
@@ -166,19 +166,24 @@
     unsigned int orig_fourcc=sh_video->bih?sh_video->bih->biCompression:0;
     sh_video->codec=NULL;
     sh_video->vf_inited=0;
+    int force = 0;
+    if (codecname && codecname[0] == '+') {
+      codecname = &codecname[1];
+      force = 1;
+    }
 
     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,
+	if(!(sh_video->codec=find_video_codec(sh_video->format,
           sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,
-          sh_video->codec,0) )) break;
+          sh_video->codec,force) )) 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 && strcmp(sh_video->codec->drv,vfm)) continue; // vfm doesn't match
-	if(sh_video->codec->status<status) continue; // too unstable
+	if(!force && sh_video->codec->status<status) continue; // too unstable
 	sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it
 	// ok, it matches all rules, let's find the driver!
 	for (i=0; mpcodecs_vd_drivers[i] != NULL; i++)




More information about the MPlayer-cvslog mailing list