[MPlayer-cvslog] CVS: main cfg-mencoder.h, 1.100, 1.101 mencoder.c, 1.290, 1.291

Tobias Diedrich CVS syncmail at mplayerhq.hu
Sat Jul 2 21:00:14 CEST 2005


CVS change done by Tobias Diedrich CVS

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

Modified Files:
	cfg-mencoder.h mencoder.c 
Log Message:
Check for WAVEFORMAT.wFormatTag overflows and allow user to override the tag with -fafmttag

Index: cfg-mencoder.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mencoder.h,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- cfg-mencoder.h	19 Jun 2005 09:12:42 -0000	1.100
+++ cfg-mencoder.h	2 Jul 2005 19:00:12 -0000	1.101
@@ -232,6 +232,8 @@
 	// output file format
 	{"of", of_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
 
+	// override audio format tag in output file
+	{"fafmttag", &force_audiofmttag, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL},
 	// override FOURCC in output file
 	{"ffourcc", &force_fourcc, CONF_TYPE_STRING, CONF_GLOBAL, 4, 4, NULL},
 

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.290
retrieving revision 1.291
diff -u -r1.290 -r1.291
--- mencoder.c	27 Jun 2005 19:10:11 -0000	1.290
+++ mencoder.c	2 Jul 2005 19:00:12 -0000	1.291
@@ -164,6 +164,7 @@
 char* out_filename="test.avi";
 
 char *force_fourcc=NULL;
+int force_audiofmttag=-1;
 
 char* passtmpfile="divx2pass.log";
 
@@ -808,6 +809,15 @@
 // ============= AUDIO ===============
 if(sh_audio){
 
+if (force_audiofmttag != -1) {
+	sh_audio->format = force_audiofmttag;
+	if (sh_audio->wf) {
+		sh_audio->wf->wFormatTag = sh_audio->format;
+	}
+	mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_ForcingOutputAudiofmtTag,
+	       force_audiofmttag);
+}
+
 mux_a=muxer_new_stream(muxer,MUXER_TYPE_AUDIO);
 
 mux_a->buffer_size=0x100000; //16384;
@@ -850,6 +860,10 @@
 switch(mux_a->codec){
 case ACODEC_COPY:
     if (playback_speed != 1.0) mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_NoSpeedWithFrameCopy);
+    if (sh_audio->format >= 0x10000) {
+	mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantCopyAudioFormat, sh_audio->format);
+	mencoder_exit(1,NULL);
+    }
     if (sh_audio->wf){
 	mux_a->wf=malloc(sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize);
 	memcpy(mux_a->wf, sh_audio->wf, sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize);




More information about the MPlayer-cvslog mailing list