diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-09-03 17:42:31 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-09-03 17:42:31 +0000 |
commit | c1f99ddeb10d641e5faed32a284bc9a5f64b8a4b (patch) | |
tree | 97272c4b0b940aa39419c8bdc54d5179ef827c31 /libass/ass_mp.c | |
parent | 959013d794716739c300d853ef89c96e7c271c6f (diff) | |
download | libass-c1f99ddeb10d641e5faed32a284bc9a5f64b8a4b.tar.bz2 libass-c1f99ddeb10d641e5faed32a284bc9a5f64b8a4b.tar.xz |
Add -ass-styles option. It allows to load styles from a file and use them
for plain text subtitles rendering.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19658 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass/ass_mp.c')
-rw-r--r-- | libass/ass_mp.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libass/ass_mp.c b/libass/ass_mp.c index ec4994e0..92b8eb48 100644 --- a/libass/ass_mp.c +++ b/libass/ass_mp.c @@ -19,6 +19,7 @@ char **ass_force_style_list = NULL; int ass_use_margins = 0; char* ass_color = NULL; char* ass_border_color = NULL; +char* ass_styles_file = NULL; extern int font_fontconfig; extern char* font_name; @@ -30,10 +31,6 @@ extern void process_force_style(ass_track_t* track); ass_track_t* ass_default_track() { ass_track_t* track = ass_new_track(); - ass_style_t* style; - int sid; - double fs; - uint32_t c1, c2; track->track_type = TRACK_TYPE_ASS; track->Timer = 100.; @@ -41,6 +38,15 @@ ass_track_t* ass_default_track() { track->PlayResY = 288; track->WrapStyle = 0; + if (ass_styles_file) + ass_read_styles(track, ass_styles_file); + + if (track->n_styles == 0) { + ass_style_t* style; + int sid; + double fs; + uint32_t c1, c2; + sid = ass_alloc_style(track); style = track->styles + sid; style->Name = strdup("Default"); @@ -71,6 +77,7 @@ ass_track_t* ass_default_track() { style->MarginV = 20; style->ScaleX = 1.; style->ScaleY = 1.; + } return track; } |