summaryrefslogtreecommitdiffstats
path: root/sub/osd_libass.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-04 17:16:40 +0200
committerwm4 <wm4@nowhere>2012-10-16 07:26:32 +0200
commitcc05910f16a5ccd8e3dca26a89e9c3835cbdb645 (patch)
treea95fcec3775de31f0fd5b4f52a43f60115bc292c /sub/osd_libass.c
parent05f4f00e24caf23646a2b551b8e1a1a1abe76de7 (diff)
downloadmpv-cc05910f16a5ccd8e3dca26a89e9c3835cbdb645.tar.bz2
mpv-cc05910f16a5ccd8e3dca26a89e9c3835cbdb645.tar.xz
sub: cosmetics: move things around
Move sub-bitmap definitions from dec_sub.h to sub.h. While it's a bit odd that OSD data structures are in a file named sub.h, it's definitely way too strange to have them in a file about subtitle decoding. (Maybe sub.h/.c and the sub/ directory should be split out and renamed "osd" at a later point.) Remove including ass_mp.h (and the libass headers) where possible. Remove typedefs for mp_eosd_res and sub_bitmaps structs. Store a mp_eosd_res struct in osd_state instead of just w/h. Note that sbtitles might be rendered using different sizes/margins when filters are involved (the subtitle renderer is not supposed to use the OSD res directly, and the "dim" member removed in the previous commit is something different).
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r--sub/osd_libass.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 811bc009f3..f3296c6091 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -196,7 +196,7 @@ static void update_progbar(struct osd_state *osd, struct osd_object *obj)
// Assume the OSD bar takes 2/3 of the OSD width at PlayResY=288 and
// FontSize=22 with an OSD aspect ratio of 16:9. Rescale as needed.
// xxx can fail when unknown fonts are involved
- double asp = (double)osd->w / osd->h;
+ double asp = (double)osd->res.w / osd->res.h;
double scale = (asp / 1.77777) * (obj->osd_track->PlayResY / 288.0);
style->ScaleX = style->ScaleY = scale;
style->FontSize = 22.0;
@@ -285,7 +285,7 @@ void osd_object_get_bitmaps(struct osd_state *osd, struct osd_object *obj,
if (!obj->osd_track)
return;
- ass_set_frame_size(osd->osd_render, osd->w, osd->h);
+ ass_set_frame_size(osd->osd_render, osd->res.w, osd->res.h);
mp_ass_render_frame(osd->osd_render, obj->osd_track, 0,
&obj->parts_cache, out_imgs);
talloc_steal(obj, obj->parts_cache);