diff mencoder.c @ 14685:4b02f759f529

small reordering to make future 'multiple files' changes more modular, puts single file loading separate from global option loading in the begginning. patch by Oded Shimon
author reynaldo
date Sat, 12 Feb 2005 15:11:02 +0000
parents 9e81b41838e6
children 7a2adc5e8928
line wrap: on
line diff
--- a/mencoder.c	Sat Feb 12 14:45:54 2005 +0000
+++ b/mencoder.c	Sat Feb 12 15:11:02 2005 +0000
@@ -454,13 +454,6 @@
  parse_cfgfiles(mconfig);
  filelist = m_config_parse_me_command_line(mconfig, argc, argv);
  if(!filelist) mencoder_exit(1, MSGTR_ErrorParsingCommandLine);
- m_entry_set_options(mconfig,&filelist[0]);
- filename = filelist[0].name;
-
-  if(!filename){
-	mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_MissingFilename);
-	mencoder_exit(1,NULL);
-  }
 
   mp_msg_set_level(verbose+MSGL_STATUS);
 
@@ -489,6 +482,13 @@
 
   vo_init_osd();
 
+  m_entry_set_options(mconfig,&filelist[0]);
+  filename = filelist[0].name;
+ 
+  if(!filename){
+	mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_MissingFilename);
+	mencoder_exit(1,NULL);
+  }
   stream=open_stream(filename,0,&file_format);
 
   if(!stream){
@@ -571,6 +571,21 @@
   mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n");
 }
 
+#ifdef USE_SUB
+// after reading video params we should load subtitles because
+// we know fps so now we can adjust subtitles time to ~6 seconds AST
+// check .sub
+//  current_module="read_subtitles_file";
+  if(sub_name && sub_name[0]){
+    subdata=sub_read_file(sub_name[0], sh_video->fps);
+    if(!subdata) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name[0]);
+  } else
+  if(sub_auto) { // auto load sub file ...
+    subdata=sub_read_file( filename ? sub_filenames( get_path("sub/"), filename )[0]
+	                              : "default.sub", sh_video->fps );
+  }
+#endif	
+
 // set up video encoder:
 
 if (vobsub_out) {
@@ -613,21 +628,6 @@
 #endif
 }
 
-#ifdef USE_SUB
-// after reading video params we should load subtitles because
-// we know fps so now we can adjust subtitles time to ~6 seconds AST
-// check .sub
-//  current_module="read_subtitles_file";
-  if(sub_name && sub_name[0]){
-    subdata=sub_read_file(sub_name[0], sh_video->fps);
-    if(!subdata) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name[0]);
-  } else
-  if(sub_auto) { // auto load sub file ...
-    subdata=sub_read_file( filename ? sub_filenames( get_path("sub/"), filename )[0]
-	                              : "default.sub", sh_video->fps );
-  }
-#endif	
-
 // Apply current settings for forced subs
 spudec_set_forced_subs_only(vo_spudec,forced_subs_only);