summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-23 15:55:09 +0100
committerwm4 <wm4@nowhere>2017-01-23 15:55:09 +0100
commit00eadcec8d59c3868bade4b3013b05127e75d5a2 (patch)
treee8985aa67252864def53aacbd4b23e2e170d5f98
parent3e89e061c25e32195677a2c7a239b512cdd3cca9 (diff)
downloadmpv-00eadcec8d59c3868bade4b3013b05127e75d5a2.tar.bz2
mpv-00eadcec8d59c3868bade4b3013b05127e75d5a2.tar.xz
sub: add option to force using video resolution for image subtitles
Basically for debugging and dealing with broken files.
-rw-r--r--DOCS/man/options.rst7
-rw-r--r--options/options.c1
-rw-r--r--options/options.h1
-rw-r--r--sub/sd_lavc.c2
4 files changed, 10 insertions, 1 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 2625c118a0..c1942cf0c6 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -1730,6 +1730,13 @@ Subtitles
Disabled by default.
+``--image-subs-video-resolution=<yes|no>``
+ Override the image subtitle resolution with the video resolution
+ (default: no). Normally, the subtitle canvas is fit into the video canvas
+ (e.g. letterboxed). Setting this option uses the video size as subtitle
+ canvas size. Can be useful to test broken subtitles, which often happen
+ when the video was trancoded, while attempting to keep the old subtitles.
+
``--sub-ass``, ``--no-sub-ass``
Render ASS subtitles natively (enabled by default).
diff --git a/options/options.c b/options/options.c
index 71f5d79fa6..ed10299480 100644
--- a/options/options.c
+++ b/options/options.c
@@ -473,6 +473,7 @@ const m_option_t mp_opts[] = {
OPT_FLAG("sub-forced-only", forced_subs_only, UPDATE_OSD),
OPT_FLAG("stretch-dvd-subs", stretch_dvd_subs, UPDATE_OSD),
OPT_FLAG("stretch-image-subs-to-screen", stretch_image_subs, UPDATE_OSD),
+ OPT_FLAG("image-subs-video-resolution", image_subs_video_res, UPDATE_OSD),
OPT_FLAG("sub-fix-timing", sub_fix_timing, 0),
OPT_CHOICE("sub-auto", sub_auto, 0,
({"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})),
diff --git a/options/options.h b/options/options.h
index f5d1a8a0a0..6199eae5fe 100644
--- a/options/options.h
+++ b/options/options.h
@@ -212,6 +212,7 @@ typedef struct MPOpts {
int forced_subs_only;
int stretch_dvd_subs;
int stretch_image_subs;
+ int image_subs_video_res;
int sub_fix_timing;
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
index 6b7cd07dcb..b660912bf5 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -439,7 +439,7 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, int format,
d.ml = d.mr = d.mt = d.mb = 0;
int w = priv->avctx->width;
int h = priv->avctx->height;
- if (w <= 0 || h <= 0) {
+ if (w <= 0 || h <= 0 || opts->image_subs_video_res) {
w = priv->video_params.w;
h = priv->video_params.h;
}