summaryrefslogtreecommitdiffstats
path: root/sub/osd_libass.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-24 14:36:14 +0100
committerwm4 <wm4@nowhere>2015-02-24 14:36:14 +0100
commit9fbcb56bee787b32be53cf240dd95b77d1a3921d (patch)
tree4bb67a474a96ac390d0f98c542d6ad7061f296dd /sub/osd_libass.c
parentcc011415ffb10521260e486a41b56d0080bf2cd9 (diff)
downloadmpv-9fbcb56bee787b32be53cf240dd95b77d1a3921d.tar.bz2
mpv-9fbcb56bee787b32be53cf240dd95b77d1a3921d.tar.xz
osd: always reset style params
There was some logic to set certain things on init only. Not sure why this was done (saving some cheap calculations?) - but since the next call would override these style settings by applying the usual subtitle style, I don't think this was intended.
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r--sub/osd_libass.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 68da28b9cd..861fa83c71 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -301,7 +301,6 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj,
{
struct MPOpts *opts = osd->opts;
- bool new_track = !obj->osd_track;
create_ass_track(osd, obj, 0, 0);
ASS_Track *track = obj->osd_track;
ASS_Style *style = track->styles + track->default_style;
@@ -309,16 +308,14 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj,
*o_w = track->PlayResX * (opts->osd_bar_w / 100.0);
*o_h = track->PlayResY * (opts->osd_bar_h / 100.0);
- if (new_track) {
- float base_size = 0.03125;
- style->Outline *= *o_h / track->PlayResY / base_size;
- // So that the chapter marks have space between them
- style->Outline = FFMIN(style->Outline, *o_h / 5.2);
- // So that the border is not 0
- style->Outline = FFMAX(style->Outline, *o_h / 32.0);
- // Rendering with shadow is broken (because there's more than one shape)
- style->Shadow = 0;
- }
+ float base_size = 0.03125;
+ style->Outline *= *o_h / track->PlayResY / base_size;
+ // So that the chapter marks have space between them
+ style->Outline = FFMIN(style->Outline, *o_h / 5.2);
+ // So that the border is not 0
+ style->Outline = FFMAX(style->Outline, *o_h / 32.0);
+ // Rendering with shadow is broken (because there's more than one shape)
+ style->Shadow = 0;
*o_border = style->Outline;