# HG changeset patch # User reimar # Date 1327015237 0 # Node ID fede902a408cc1a762f7c70ae3ea08d6dd72e67e # Parent da31318562d9bc4336ba6f7f09942cb4fb502690 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. diff -r da31318562d9 -r fede902a408c mencoder.c --- a/mencoder.c Thu Jan 19 14:36:17 2012 +0000 +++ b/mencoder.c Thu Jan 19 23:20:37 2012 +0000 @@ -638,6 +638,16 @@ 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 (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 diff -r da31318562d9 -r fede902a408c mplayer.c --- a/mplayer.c Thu Jan 19 14:36:17 2012 +0000 +++ b/mplayer.c Thu Jan 19 23:20:37 2012 +0000 @@ -3165,6 +3165,12 @@ // 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 ==================== diff -r da31318562d9 -r fede902a408c sub/ass_mp.c --- a/sub/ass_mp.c Thu Jan 19 14:36:17 2012 +0000 +++ b/sub/ass_mp.c Thu Jan 19 23:20:37 2012 +0000 @@ -303,14 +303,22 @@ } } +/** + * 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; } diff -r da31318562d9 -r fede902a408c sub/ass_mp.h --- a/sub/ass_mp.h Thu Jan 19 14:36:17 2012 +0000 +++ b/sub/ass_mp.h Thu Jan 19 23:20:37 2012 +0000 @@ -52,6 +52,7 @@ 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 {