summaryrefslogtreecommitdiffstats
path: root/sub/sd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-21 11:37:32 +0200
committerwm4 <wm4@nowhere>2014-10-21 11:37:32 +0200
commitbcc3d72995e926f899c0baa215599c50e23b9523 (patch)
tree48738a3437f399cc95b0143da2a316b966bbd3f6 /sub/sd_lavc.c
parent38420eb49e9fadefae793240bf5698984ec8d623 (diff)
downloadmpv-bcc3d72995e926f899c0baa215599c50e23b9523.tar.bz2
mpv-bcc3d72995e926f899c0baa215599c50e23b9523.tar.xz
sd_lavc: strictly letter-box PGS subtitles
Getting subtitle scaling and positioning right even if there are video filters, which completely change the image (like cropping), doesn't seem to have a single, correct solution. To some degree, the results are arbitrary, so we may as well do what is most useful to the user. In this case, if the PGS resolution aspect ratio and the video output aspect ratio mismatch, letter-box it, instead of stretching the subs over the video frame. (This will require additional fixes, should it turn out that there are PGS subtitles which are stretched by design.) Fixes #1205.
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r--sub/sd_lavc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
index 206571e30b..5e0398d41c 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -292,7 +292,7 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, double pts,
priv->displayed_id = current->id;
res->format = SUBBITMAP_INDEXED;
- double video_par = -1;
+ double video_par = 0;
if (priv->avctx->codec_id == AV_CODEC_ID_DVD_SUBTITLE &&
opts->stretch_dvd_subs) {
// For DVD subs, try to keep the subtitle PAR at display PAR.
@@ -302,6 +302,8 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, double pts,
if (isnormal(par))
video_par = par;
}
+ if (priv->avctx->codec_id == AV_CODEC_ID_HDMV_PGS_SUBTITLE)
+ video_par = -1;
int insize[2];
get_resolution(sd, insize);
osd_rescale_bitmaps(res, insize[0], insize[1], d, video_par);