[MPlayer-cvslog] r34582 - in trunk: mencoder.c mplayer.c sub/ass_mp.c sub/ass_mp.h

reimar subversion at mplayerhq.hu
Fri Jan 20 00:20:38 CET 2012


Author: reimar
Date: Fri Jan 20 00:20:37 2012
New Revision: 34582

Log:
Fix per-file ASS options like -ass-force-style.

Previously the per-file settings were (sometimes at least)
completely ignored and only the global ones used.

Modified:
   trunk/mencoder.c
   trunk/mplayer.c
   trunk/sub/ass_mp.c
   trunk/sub/ass_mp.h

Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c	Thu Jan 19 15:36:17 2012	(r34581)
+++ trunk/mencoder.c	Fri Jan 20 00:20:37 2012	(r34582)
@@ -638,6 +638,16 @@ play_next_file:
 	mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_MissingFilename);
 	mencoder_exit(1,NULL);
   }
+
+  if (vobsub_name)
+    vo_vobsub = vobsub_open(vobsub_name, spudec_ifo, 1, &vo_spudec);
+#ifdef CONFIG_ASS
+  // must be before demuxer open, since the settings are
+  // used in generating the ASSTrack
+  if (ass_enabled && ass_library)
+    ass_mp_reset_config(ass_library);
+#endif
+
   stream=open_stream(filename,0,&file_format);
 
   if(!stream){
@@ -769,9 +779,6 @@ if(sh_audio && (out_audio_codec || seek_
     }
   }
 
-  if (vobsub_name)
-    vo_vobsub = vobsub_open(vobsub_name, spudec_ifo, 1, &vo_spudec);
-
 // set up video encoder:
 
 if (!curfile) { // curfile is non zero when a second file is opened

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Thu Jan 19 15:36:17 2012	(r34581)
+++ trunk/mplayer.c	Fri Jan 20 00:20:37 2012	(r34582)
@@ -3165,6 +3165,12 @@ play_next_file:
         // setup global sub numbering
         mpctx->sub_counts[SUB_SOURCE_VOBSUB] = vobsub_get_indexes_count(vo_vobsub);
     }
+#ifdef CONFIG_ASS
+    // must be before demuxer open, since the settings are
+    // used in generating the ASSTrack
+    if (ass_enabled && ass_library)
+        ass_mp_reset_config(ass_library);
+#endif
 
 //============ Open & Sync STREAM --- fork cache2 ====================
 

Modified: trunk/sub/ass_mp.c
==============================================================================
--- trunk/sub/ass_mp.c	Thu Jan 19 15:36:17 2012	(r34581)
+++ trunk/sub/ass_mp.c	Fri Jan 20 00:20:37 2012	(r34582)
@@ -303,14 +303,22 @@ static void message_callback(int level, 
 	}
 }
 
+/**
+ * Reset all per-file settings for next file.
+ */
+void ass_mp_reset_config(ASS_Library *l) {
+	ass_set_extract_fonts(l, extract_embedded_fonts);
+	ass_set_style_overrides(l, ass_force_style_list);
+	ass_force_reload = 1;
+}
+
 ASS_Library* ass_init(void) {
 	ASS_Library* priv;
 	char* path = get_path("fonts");
 	priv = ass_library_init();
 	ass_set_message_cb(priv, message_callback, NULL);
 	ass_set_fonts_dir(priv, path);
-	ass_set_extract_fonts(priv, extract_embedded_fonts);
-	ass_set_style_overrides(priv, ass_force_style_list);
+	ass_mp_reset_config(priv);
 	free(path);
 	return priv;
 }

Modified: trunk/sub/ass_mp.h
==============================================================================
--- trunk/sub/ass_mp.h	Thu Jan 19 15:36:17 2012	(r34581)
+++ trunk/sub/ass_mp.h	Fri Jan 20 00:20:37 2012	(r34582)
@@ -52,6 +52,7 @@ ASS_Track* ass_read_stream(ASS_Library* 
 
 void ass_configure(ASS_Renderer* priv, int w, int h, int hinting);
 void ass_configure_fonts(ASS_Renderer* priv);
+void ass_mp_reset_config(ASS_Library *l);
 ASS_Library* ass_init(void);
 
 typedef struct {


More information about the MPlayer-cvslog mailing list