[MPlayer-dev-eng] [PATCH] Make frameno.avi optional

Oded Shimon ods15 at ods15.dyndns.org
Mon Sep 19 13:22:16 CEST 2005


I'd like to atleast make this very obsolete feature optional (I'm in favor 
of ripping it out of MEncoder altogether, MEncoder's source is hackish 
enough as it is...).
With this patch, you have -frameno-file where you can now actually specify 
the frameno filename, and also MEncoder doesn't show the very annoying and 
very stupid 'file not found frameno.avi' at startup.
I'm not sure if to document this option at all, as it'll encourage people 
to actually use it.

Thoughts? I'll commit soon if no-one objects, and that's a threat. (It 
breaks any scripts which assumed MEncoder automatically uses frameno.avi)

- ods15
-------------- next part --------------
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.305
diff -u -r1.305 mencoder.c
--- mencoder.c	5 Aug 2005 19:57:44 -0000	1.305
+++ mencoder.c	19 Sep 2005 11:14:42 -0000
@@ -235,6 +235,8 @@
 static char *seek_to_sec=NULL;
 static off_t seek_to_byte=0;
 
+static char * frameno_filename=NULL;
+
 static void parse_end_at();
 static char * end_at_string=0;
 //static uint8_t* flip_upside_down(uint8_t* dst, const uint8_t* src, int width, int height);
@@ -387,7 +389,6 @@
 
 m_entry_t* filelist = NULL;
 char* filename=NULL;
-char* frameno_filename="frameno.avi";
 
 int decoded_frameno=0;
 int next_frameno=-1;
@@ -452,14 +453,6 @@
   }
 }
 
-  // FIXME: get rid of -dvd and other tricky options
-  stream2=open_stream(frameno_filename,0,&i);
-  if(stream2){
-    demuxer2=demux_open(stream2,DEMUXER_TYPE_AVI,-1,-1,-2,NULL);
-    if(demuxer2) mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_UsingPass3ControllFile, frameno_filename);
-    else mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized);
-  }
-
  mconfig = m_config_new();
  m_config_register_options(mconfig,mencoder_opts);
  parse_cfgfiles(mconfig);
@@ -468,6 +461,16 @@
 
   mp_msg_set_level(verbose+MSGL_STATUS);
 
+if (frameno_filename) {
+  // FIXME: get rid of -dvd and other tricky options
+  stream2=open_stream(frameno_filename,0,&i);
+  if(stream2){
+    demuxer2=demux_open(stream2,DEMUXER_TYPE_AVI,-1,-1,-2,NULL);
+    if(demuxer2) mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_UsingPass3ControllFile, frameno_filename);
+    else mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized);
+  }
+}
+
 #ifdef WIN32
   if(proc_priority){
     int i;
Index: cfg-mencoder.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mencoder.h,v
retrieving revision 1.102
diff -u -r1.102 cfg-mencoder.h
--- cfg-mencoder.h	17 Jul 2005 19:25:33 -0000	1.102
+++ cfg-mencoder.h	19 Sep 2005 11:14:43 -0000
@@ -202,6 +202,7 @@
 	/* name, pointer, type, flags, min, max */
 
 	{"endpos", &end_at_string, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"frameno-file", &frameno_filename, CONF_TYPE_STRING, 0, 0, 0, NULL},
 
 #ifdef USE_EDL
         {"hr-edl-seek", &edl_seek_type, CONF_TYPE_FLAG, 0, 0, 1, NULL},


More information about the MPlayer-dev-eng mailing list