summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
Diffstat (limited to 'sub')
-rw-r--r--sub/osd.c5
-rw-r--r--sub/sd_ass.c6
-rw-r--r--sub/sd_lavc.c7
3 files changed, 6 insertions, 12 deletions
diff --git a/sub/osd.c b/sub/osd.c
index 2d11b80cbb..ba4011c040 100644
--- a/sub/osd.c
+++ b/sub/osd.c
@@ -388,13 +388,10 @@ void osd_draw_on_image_p(struct osd_state *osd, struct mp_osd_res res,
// ratio if the image does not have a 1:1 pixel aspect ratio.
struct mp_osd_res osd_res_from_image_params(const struct mp_image_params *p)
{
- double sar = (double)p->w / p->h;
- double dar = (double)p->d_w / p->d_h;
-
return (struct mp_osd_res) {
.w = p->w,
.h = p->h,
- .display_par = sar / dar,
+ .display_par = p->p_h / (double)p->p_w,
};
}
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index baf35b5d30..32179c843d 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -343,11 +343,9 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts,
opts->ass_vsfilter_aspect_compat))
{
// Let's use the original video PAR for vsfilter compatibility:
- double par = scale
- * (ctx->video_params.d_w / (double)ctx->video_params.d_h)
- / (ctx->video_params.w / (double)ctx->video_params.h);
+ double par = ctx->video_params.p_w / (double)ctx->video_params.p_h;
if (isnormal(par))
- scale = par;
+ scale *= par;
}
configure_ass(sd, &dim, converted, track);
ass_set_pixel_aspect(renderer, scale);
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
index 08fff28d8a..86aaf4fda9 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -318,11 +318,10 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, double pts,
double video_par = 0;
if (priv->avctx->codec_id == AV_CODEC_ID_DVD_SUBTITLE &&
- opts->stretch_dvd_subs) {
+ opts->stretch_dvd_subs)
+ {
// For DVD subs, try to keep the subtitle PAR at display PAR.
- double par =
- (priv->video_params.d_w / (double)priv->video_params.d_h)
- / (priv->video_params.w / (double)priv->video_params.h);
+ double par = priv->video_params.p_w / (double)priv->video_params.p_h;
if (isnormal(par))
video_par = par;
}