summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-21 23:07:24 +0200
committerwm4 <wm4@nowhere>2015-10-21 23:07:39 +0200
commitdd08018e9e936a20b413a5d6814ca12b041ffef2 (patch)
treeac1b0e2e3d04df63e816aee44e98d8c97ac400e9 /sub
parent56d04c65703e41afbea81fcdfbf43f8034552db9 (diff)
downloadmpv-dd08018e9e936a20b413a5d6814ca12b041ffef2.tar.bz2
mpv-dd08018e9e936a20b413a5d6814ca12b041ffef2.tar.xz
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.
Diffstat (limited to 'sub')
-rw-r--r--sub/osd.c9
1 files changed, 2 insertions, 7 deletions
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++) {