From dd08018e9e936a20b413a5d6814ca12b041ffef2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 21 Oct 2015 23:07:24 +0200 Subject: sub: adjust behavior on mismatching video/subtitle aspect mismatch If the aspect ratio of the video resolution and the subtitle resolution (the implied subtitle coordinate system) mismatch, the subtitles obviously can't be overlayed over the video perfectly. Either you get video that can't be covered by subtitles, or the subtitles could go beyond the video. We don't want to stretch the subtitle to compensate for the aspect ratio, because it would look terrible. Until now, mpv used to fit the subtitle rectangle into the video rectangle (letterboxing/pillarboxing). This looks odd with some sample files with subtitle canvas being wider than the video. Also, mpc-hc displays them in a better way. vlc stretches them, which looks bad. While you probably can't win this game with all those broken files around, pick the mpc-hc method to handle this. --- sub/osd.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'sub') diff --git a/sub/osd.c b/sub/osd.c index fcfca2aa26..b4de8fee92 100644 --- a/sub/osd.c +++ b/sub/osd.c @@ -480,13 +480,8 @@ void osd_rescale_bitmaps(struct sub_bitmaps *imgs, int frame_w, int frame_h, double yscale = (double)vidh / frame_h; if (compensate_par < 0) compensate_par = xscale / yscale / res.display_par; - if (compensate_par > 0) { - if (compensate_par > 1.0) { - xscale /= compensate_par; - } else { - yscale *= compensate_par; - } - } + if (compensate_par > 0) + xscale /= compensate_par; int cx = vidw / 2 - (int)(frame_w * xscale) / 2; int cy = vidh / 2 - (int)(frame_h * yscale) / 2; for (int i = 0; i < imgs->num_parts; i++) { -- cgit v1.2.3