changeset 12363:5dac21977312

Allow user to disable writing of ODML index
author ranma
date Fri, 30 Apr 2004 21:33:53 +0000
parents cccdd44a8030
children cfd1b419dbcd
files DOCS/man/en/mplayer.1 cfg-mencoder.h libmpdemux/muxer_avi.c
diffstat 3 files changed, 23 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Fri Apr 30 20:36:48 2004 +0000
+++ b/DOCS/man/en/mplayer.1	Fri Apr 30 21:33:53 2004 +0000
@@ -3974,6 +3974,10 @@
 Useful to control at which point of the filter chain subtitles are rendered
 when hardcoding subtitles onto a movie.
 .TP
+.B \-noodml
+Do not write OpenDML index for files >1GB.
+Applies to \-of avi only.
+.TP
 .B \-noskip
 Do not skip frames.
 .TP
--- a/cfg-mencoder.h	Fri Apr 30 20:36:48 2004 +0000
+++ b/cfg-mencoder.h	Fri Apr 30 21:33:53 2004 +0000
@@ -161,6 +161,7 @@
 };
 
 extern float avi_aspect_override; /* defined in libmpdemux/muxer_avi.c */
+extern int write_odml; /* defined in libmpdemux/muxer_avi.c */
 
 m_option_t mencoder_opts[]={
 	/* name, pointer, type, flags, min, max */
@@ -210,6 +211,9 @@
 	{"encodedups", &encode_duplicates, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"noencodedups", &encode_duplicates, CONF_TYPE_FLAG, 0, 1, 0, NULL},
 	
+	{"odml", &write_odml, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"noodml", &write_odml, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+	
 	// info header strings
 	{"info", info_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
 
--- a/libmpdemux/muxer_avi.c	Fri Apr 30 20:36:48 2004 +0000
+++ b/libmpdemux/muxer_avi.c	Fri Apr 30 21:33:53 2004 +0000
@@ -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;