mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
56d04c6570
commit
dd08018e9e
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue