summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-21 20:19:39 +0200
committerwm4 <wm4@nowhere>2017-07-21 20:19:39 +0200
commit2378acc3b3e9825765c549e025bc1ca83064cced (patch)
tree186f115fad588eeccec369690cbd594788f8331a
parent533ff28574ef179524a1f25b0b145d92137457a7 (diff)
downloadmpv-2378acc3b3e9825765c549e025bc1ca83064cced.tar.bz2
mpv-2378acc3b3e9825765c549e025bc1ca83064cced.tar.xz
options: drop --video-aspect-method=hybrid
Remove this code because it could be argued that it contains GPL-only code (see commit 642e963c860 for details). The remaining aspect methods appear to work just as well, are potentially more compatible to other players, and the code becomes much simpler.
-rw-r--r--DOCS/interface-changes.rst1
-rw-r--r--DOCS/man/options.rst5
-rw-r--r--options/options.c2
-rw-r--r--video/decode/dec_video.c31
-rw-r--r--video/decode/dec_video.h1
5 files changed, 6 insertions, 34 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst
index 2fd57c9e90..a9a6664461 100644
--- a/DOCS/interface-changes.rst
+++ b/DOCS/interface-changes.rst
@@ -25,6 +25,7 @@ Interface changes
- remove client API compatibility handling for "script", "sub-file",
"audio-file", "external-file" (these cases used to log a deprecation
warning)
+ - drop deprecated --video-aspect-method=hybrid option choice
--- mpv 0.26.0 ---
- remove remaining deprecated audio device options, like --alsa-device
Some of them were removed in earlier releases.
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index bb5ba6636a..df640c8af5 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -835,13 +835,10 @@ Video
- ``--video-aspect=16:9`` or ``--video-aspect=1.7777``
- ``--no-video-aspect`` or ``--video-aspect=no``
-``--video-aspect-method=<hybrid|bitstream|container>``
+``--video-aspect-method=<bitstream|container>``
This sets the default video aspect determination method (if the aspect is
_not_ overridden by the user with ``--video-aspect`` or others).
- :hybrid: Prefer the container aspect ratio. If the bitstream aspect
- switches mid-stream, switch to preferring the bitstream aspect.
- This was the default in older mpv and mplayer2. Deprecated.
:container: Strictly prefer the container aspect ratio. This is apparently
the default behavior with VLC, at least with Matroska. Note that
if the container has no aspect ratio set, the behavior is the
diff --git a/options/options.c b/options/options.c
index 56df6706ee..beceaf747f 100644
--- a/options/options.c
+++ b/options/options.c
@@ -443,7 +443,7 @@ const m_option_t mp_opts[] = {
// 0 means square pixels
OPT_ASPECT("video-aspect", movie_aspect, UPDATE_IMGPAR, -1.0, 10.0),
OPT_CHOICE("video-aspect-method", aspect_method, UPDATE_IMGPAR,
- ({"hybrid", 0}, {"bitstream", 1}, {"container", 2})),
+ ({"bitstream", 1}, {"container", 2})),
OPT_SUBSTRUCT("vd-lavc", vd_lavc_params, vd_lavc_conf, 0),
OPT_SUBSTRUCT("ad-lavc", ad_lavc_params, ad_lavc_conf, 0),
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index c98ab2b8b7..b1afdf3a18 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -205,35 +205,10 @@ static void fix_image_params(struct dec_video *d_video,
// While mp_image_params normally always have to have d_w/d_h set, the
// decoder signals unknown bitstream aspect ratio with both set to 0.
- float dec_aspect = p.p_w > 0 && p.p_h > 0 ? p.p_w / (float)p.p_h : 0;
-
-#if HAVE_GPL
- if (d_video->initial_decoder_aspect == 0)
- d_video->initial_decoder_aspect = dec_aspect;
-#endif
-
bool use_container = true;
- switch (opts->aspect_method) {
- case 0:
-#if HAVE_GPL
- // We normally prefer the container aspect, unless the decoder aspect
- // changes at least once.
- if (dec_aspect > 0 && d_video->initial_decoder_aspect != dec_aspect) {
- MP_VERBOSE(d_video, "Using bitstream aspect ratio.\n");
- // Even if the aspect switches back, don't use container aspect again.
- d_video->initial_decoder_aspect = -1;
- use_container = false;
- }
- break;
-#else
- /* fall through, behave as "bitstream" */
-#endif
- case 1:
- if (dec_aspect) {
- MP_VERBOSE(d_video, "Using bitstream aspect ratio.\n");
- use_container = false;
- }
- break;
+ if (opts->aspect_method == 1 && p.p_w > 0 && p.p_h > 0) {
+ MP_VERBOSE(d_video, "Using bitstream aspect ratio.\n");
+ use_container = false;
}
if (use_container && c->par_w > 0 && c->par_h) {
diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h
index 8d1936e016..261f47fca8 100644
--- a/video/decode/dec_video.h
+++ b/video/decode/dec_video.h
@@ -72,7 +72,6 @@ struct dec_video {
double decoded_pts;
struct mp_image_params dec_format, last_format, fixed_format;
- float initial_decoder_aspect;
double start_pts;
double start, end;