[Mplayer-cvslog] CVS: main/libmpdemux muxer_avi.c,1.25,1.26

Tobias Diedrich CVS syncmail at mplayerhq.hu
Fri Apr 30 23:33:55 CEST 2004


CVS change done by Tobias Diedrich CVS

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

Modified Files:
	muxer_avi.c 
Log Message:
Allow user to disable writing of ODML index

Index: muxer_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer_avi.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- muxer_avi.c	28 Apr 2004 10:18:33 -0000	1.25
+++ muxer_avi.c	30 Apr 2004 21:33:53 -0000	1.26
@@ -33,6 +33,7 @@
 #define MOVIALIGN        0x00001000
 
 float avi_aspect_override = -1.0;
+int write_odml = 1;
 
 struct avi_odmlidx_entry {
 	uint64_t ofs;
@@ -159,7 +160,7 @@
 }
 
 static void write_avi_list(FILE *f,unsigned int id,int len);
-static void avifile_write_index(muxer_t *muxer);
+static void avifile_write_standard_index(muxer_t *muxer);
 
 static void avifile_odml_new_riff(muxer_t *muxer)
 {
@@ -198,9 +199,9 @@
     if (vsi->riffofspos == 0) {
 	rifflen += 8+muxer->idx_pos*sizeof(AVIINDEXENTRY);
     }
-    if (rifflen + paddedlen > ODML_CHUNKLEN) {
+    if (rifflen + paddedlen > ODML_CHUNKLEN && write_odml == 1) {
 	if (vsi->riffofspos == 0) {
-            avifile_write_index(muxer);
+            avifile_write_standard_index(muxer);
 	}
 	avifile_odml_new_riff(muxer);
     }
@@ -624,13 +625,7 @@
   muxer->file_end=ftello(muxer->file);
 }
 
-static void avifile_write_index(muxer_t *muxer){
-
-  if(muxer->file_end > ODML_CHUNKLEN &&
-     muxer->idx && muxer->idx_pos>0) {
-    avifile_odml_write_index(muxer);
-    return;
-  }
+static void avifile_write_standard_index(muxer_t *muxer){
 
   muxer->movi_end=ftello(muxer->file);
   if(muxer->idx && muxer->idx_pos>0){
@@ -646,6 +641,16 @@
   muxer->file_end=ftello(muxer->file);
 }
 
+static void avifile_write_index(muxer_t *muxer){
+  struct avi_stream_info *vsi = muxer->def_v->priv;
+
+  if (vsi->riffofspos > 0){
+    avifile_odml_write_index(muxer);
+  } else {
+    avifile_write_standard_index(muxer);
+  }
+}
+
 void muxer_init_muxer_avi(muxer_t *muxer){
   muxer->cont_new_stream = &avifile_new_stream;
   muxer->cont_write_chunk = &avifile_write_chunk;




More information about the MPlayer-cvslog mailing list