aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-11-29 13:53:55 +0100
committerGravatar wm4 <wm4@nowhere>2015-11-29 17:55:02 +0100
commit8bf34950c101fbc6c0fd7135be600e6d53395ff6 (patch)
tree863f7dc472b7cd4b336bf3463651f052ca31d29d
parent2b990ac8105f500aafc43b617eb35d474f1c5107 (diff)
sub: remove unused function, move another one
mp_ass_default_track() was not used by anything anymore (commit 5a89150a got rid of it). mp_ass_add_default_styles() is used by sd_ass.c only.
-rw-r--r--sub/ass_mp.c36
-rw-r--r--sub/ass_mp.h4
-rw-r--r--sub/sd_ass.c24
3 files changed, 24 insertions, 40 deletions
diff --git a/sub/ass_mp.c b/sub/ass_mp.c
index df32d17ce6..b30b9964de 100644
--- a/sub/ass_mp.c
+++ b/sub/ass_mp.c
@@ -78,42 +78,6 @@ void mp_ass_set_style(ASS_Style *style, double res_y,
style->Bold = opts->bold;
}
-// Add default styles, if the track does not have any styles yet.
-// Apply style overrides if the user provides any.
-void mp_ass_add_default_styles(ASS_Track *track, struct MPOpts *opts)
-{
- if (opts->ass_styles_file && opts->ass_style_override)
- ass_read_styles(track, opts->ass_styles_file, NULL);
-
- if (track->n_styles == 0) {
- if (!track->PlayResY) {
- track->PlayResY = MP_ASS_FONT_PLAYRESY;
- track->PlayResX = track->PlayResY * 4 / 3;
- }
- track->Kerning = true;
- int sid = ass_alloc_style(track);
- track->default_style = sid;
- ASS_Style *style = track->styles + sid;
- style->Name = strdup("Default");
- mp_ass_set_style(style, track->PlayResY, opts->sub_text_style);
- }
-
- if (opts->ass_style_override)
- ass_process_force_style(track);
-}
-
-ASS_Track *mp_ass_default_track(ASS_Library *library, struct MPOpts *opts)
-{
- ASS_Track *track = ass_new_track(library);
-
- track->track_type = TRACK_TYPE_ASS;
- track->Timer = 100.;
-
- mp_ass_add_default_styles(track, opts);
-
- return track;
-}
-
void mp_ass_configure_fonts(ASS_Renderer *priv, struct osd_style_opts *opts,
struct mpv_global *global, struct mp_log *log)
{
diff --git a/sub/ass_mp.h b/sub/ass_mp.h
index 176ad50c82..98311824ab 100644
--- a/sub/ass_mp.h
+++ b/sub/ass_mp.h
@@ -47,10 +47,6 @@ struct osd_style_opts;
void mp_ass_set_style(ASS_Style *style, double res_y,
const struct osd_style_opts *opts);
-void mp_ass_add_default_styles(ASS_Track *track, struct MPOpts *opts);
-
-ASS_Track *mp_ass_default_track(ASS_Library *library, struct MPOpts *opts);
-
void mp_ass_configure_fonts(ASS_Renderer *priv, struct osd_style_opts *opts,
struct mpv_global *global, struct mp_log *log);
ASS_Library *mp_ass_init(struct mpv_global *global, struct mp_log *log);
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index 97ca3fad6d..55c8d760e8 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -51,6 +51,30 @@ struct sd_ass_priv {
static void mangle_colors(struct sd *sd, struct sub_bitmaps *parts);
static void fill_plaintext(struct sd *sd, double pts);
+// Add default styles, if the track does not have any styles yet.
+// Apply style overrides if the user provides any.
+static void mp_ass_add_default_styles(ASS_Track *track, struct MPOpts *opts)
+{
+ if (opts->ass_styles_file && opts->ass_style_override)
+ ass_read_styles(track, opts->ass_styles_file, NULL);
+
+ if (track->n_styles == 0) {
+ if (!track->PlayResY) {
+ track->PlayResY = MP_ASS_FONT_PLAYRESY;
+ track->PlayResX = track->PlayResY * 4 / 3;
+ }
+ track->Kerning = true;
+ int sid = ass_alloc_style(track);
+ track->default_style = sid;
+ ASS_Style *style = track->styles + sid;
+ style->Name = strdup("Default");
+ mp_ass_set_style(style, track->PlayResY, opts->sub_text_style);
+ }
+
+ if (opts->ass_style_override)
+ ass_process_force_style(track);
+}
+
static bool supports_format(const char *format)
{
// ass-text is produced by converters and the subreader.c ssa parser; this