summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-28 15:07:18 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-28 15:07:18 +0000
commitefea99c2c9e8ea1f5a96a1cb86aa30ef05b6b828 (patch)
treed51dab1b5c89a9d2b15e52cdcc987c2d71f7ae44 /mplayer.c
parenta383ad29ea73bb4383d088d04265ec53d931f257 (diff)
downloadmpv-efea99c2c9e8ea1f5a96a1cb86aa30ef05b6b828.tar.bz2
mpv-efea99c2c9e8ea1f5a96a1cb86aa30ef05b6b828.tar.xz
Libass interface reworked:
- ass_instance_t renamed to ass_renderer_t - ass_library_t introduced - use of mplayer-specific global variables limited to ass_mp.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20493 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/mplayer.c b/mplayer.c
index acdfab9fb5..f1bb37bd0f 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -705,6 +705,12 @@ static void exit_player_with_rc(const char* how, int rc){
#endif
free_osd_list();
+#ifdef USE_ASS
+if(ass_enabled) {
+ ass_library_done(ass_library);
+}
+#endif
+
current_module="exit_player";
// free mplayer config
@@ -978,9 +984,13 @@ void add_subtitles(char *filename, float fps, int silent)
subd = sub_read_file(filename, fps);
#ifdef USE_ASS
if (ass_enabled)
- asst = ass_read_file(filename);
+#ifdef USE_ICONV
+ asst = ass_read_file(ass_library, filename, sub_cp);
+#else
+ asst = ass_read_file(ass_library, filename, 0);
+#endif
if (ass_enabled && subd && !asst)
- asst = ass_read_subdata(subd, fps);
+ asst = ass_read_subdata(ass_library, subd, fps);
if (!asst && !subd && !silent)
#else
@@ -3099,6 +3109,17 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
#endif /* USE_OSD */
vo_init_osd();
+#ifdef USE_ASS
+if(ass_enabled) {
+ char* path = get_path("fonts");
+ ass_library = ass_library_init();
+ ass_set_fonts_dir(ass_library, path);
+ ass_set_extract_fonts(ass_library, extract_embedded_fonts);
+ ass_set_style_overrides(ass_library, ass_force_style_list);
+ free(path);
+}
+#endif
+
#ifdef HAVE_RTC
if(!nortc)
{
@@ -3882,7 +3903,7 @@ sh_video->vfilter=(void*)append_filters(sh_video->vfilter);
#ifdef USE_ASS
if (ass_enabled)
- ((vf_instance_t *)sh_video->vfilter)->control(sh_video->vfilter, VFCTRL_INIT_EOSD, 0);
+ ((vf_instance_t *)sh_video->vfilter)->control(sh_video->vfilter, VFCTRL_INIT_EOSD, ass_library);
#endif
current_module="init_video_codec";