options: drop --video-aspect-method=hybrid

Remove this code because it could be argued that it contains GPL-only
code (see commit 642e963c86 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.
This commit is contained in:
wm4 2017-07-21 20:19:39 +02:00
parent 533ff28574
commit 2378acc3b3
5 changed files with 6 additions and 34 deletions

View File

@ -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.

View File

@ -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

View File

@ -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),

View File

@ -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) {

View File

@ -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;