- diff --git a/ass_mp.c b/ass_mp.c
- index 959f985..8eeb2d3 100644
- --- a/ass_mp.c
- +++ b/ass_mp.c
- -71,7 +71,7 @@ ASS_Track *ass_default_track(ASS_Library *library)
- {
- ASS_Track *track = ass_new_track(library);
- - track->track_type = TRACK_TYPE_ASS;
- + track->track_type = -1;
- track->Timer = 100.;
- track->PlayResY = 288;
- track->WrapStyle = 0;
- diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c
- index 9076ed0..49e9f94 100644
- --- a/libmpcodecs/vf_ass.c
- +++ b/libmpcodecs/vf_ass.c
- -55,6 +55,7 @@
- static const struct vf_priv_s {
- int outh, outw;
- + double scale_ratio;
- unsigned int outfmt;
- -90,13 +91,14 @@ static int config(struct vf_instance* vf,
- d_height = d_height * vf->priv->outh / height;
- }
- + vf->priv->scale_ratio = (double) width / height * d_height / d_width;
- +
- vf->priv->planes[1] = malloc(vf->priv->outw * vf->priv->outh);
- vf->priv->planes[2] = malloc(vf->priv->outw * vf->priv->outh);
- vf->priv->line_limits = malloc((vf->priv->outh + 1) / 2 * sizeof(*vf->priv->line_limits));
- if (vf->priv->ass_priv) {
- ass_configure(vf->priv->ass_priv, vf->priv->outw, vf->priv->outh, 0);
- - ass_set_aspect_ratio(vf->priv->ass_priv, 1, 1);
- }
- return vf_next_config(vf, vf->priv->outw, vf->priv->outh, d_width, d_height, flags, outfmt);
- -330,8 +332,10 @@ static int render_frame(struct vf_instance* vf, mp_image_t *mpi, const ASS_Image
- static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
- {
- ASS_Image* images = 0;
- - if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE))
- + if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE)) {
- + ass_set_aspect_ratio(vf->priv->ass_priv, (ass_track->track_type == -1) ? vf->priv->scale_ratio : 1, 1);
- images = ass_mp_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, NULL);
- + }
- prepare_image(vf, mpi);
- if (images) render_frame(vf, mpi, images);
- diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
- index b15e488..cedad3e 100644
- --- a/libmpcodecs/vf_vo.c
- +++ b/libmpcodecs/vf_vo.c
- -132,7 +132,7 @@ static int control(struct vf_instance* vf, int request, void* data)
- if (vo_control(video_out, VOCTRL_GET_EOSD_RES, &res) == VO_TRUE) {
- ass_set_frame_size(vf->priv->ass_priv, res.w, res.h);
- ass_set_margins(vf->priv->ass_priv, res.mt, res.mb, res.ml, res.mr);
- - ass_set_aspect_ratio(vf->priv->ass_priv, vf->priv->scale_ratio, 1);
- + ass_set_aspect_ratio(vf->priv->ass_priv, (ass_track->track_type == -1) ? 1 : vf->priv->scale_ratio, 1);
- }
- images.imgs = ass_mp_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, &images.changed);
