summaryrefslogtreecommitdiffstats
path: root/sub/sd_lavc.c
diff options
context:
space:
mode:
authorRudolf Polzer <divVerent@xonotic.org>2013-11-01 16:02:47 +0100
committerRudolf Polzer <divverent@xonotic.org>2013-11-07 12:56:07 +0100
commit633fde4ae541ddfe57f8111fe9b5b1fba89e6fc6 (patch)
treec00e88cd5efb55528a9f34c279101d31cb4b05be /sub/sd_lavc.c
parent49caa0a775be06539a7cd30875f1c80368a7ac55 (diff)
downloadmpv-633fde4ae541ddfe57f8111fe9b5b1fba89e6fc6.tar.bz2
mpv-633fde4ae541ddfe57f8111fe9b5b1fba89e6fc6.tar.xz
sd_lavc, sd_spu: make dvdsub stretching conditional on --stretch-dvd-subs.
We found that the stretching - although it usually improves the looks of the fonts - is incorrect. On DVD, subtitles can cover the full area of the picture, and they have the same pixel aspect as the movie itself. Too bad many commercially released DVDs use bitmap fonts made with the wrong pixel aspect (i.e. assuming 1:1) - --stretch-dvd-subs will make these more pretty then.
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 2cce6ea4cd..40039314a1 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -207,6 +207,7 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, double pts,
struct sub_bitmaps *res)
{
struct sd_lavc_priv *priv = sd->priv;
+ struct MPOpts *opts = sd->opts;
if (priv->pts != MP_NOPTS_VALUE && pts < priv->pts)
return;
@@ -223,7 +224,8 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, double pts,
int vidh = d.h - d.mt - d.mb;
double xscale = (double)vidw / inw;
double yscale = (double)vidh / inh;
- if (priv->avctx->codec_id == AV_CODEC_ID_DVD_SUBTITLE) {
+ 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.
double video_par =
(priv->video_params.d_w / (double)priv->video_params.d_h)