diff --git a/Copyright b/Copyright index d92f323a82..5dfd6a8a01 100644 --- a/Copyright +++ b/Copyright @@ -267,7 +267,7 @@ x stream/stream.h hard sub/* LGPL ta/* LGPL (ISC) video/decode/d3d.* LGPL -x video/decode/dec_video.* hard + video/decode/dec_video.* almost LGPL video/decode/hw_cuda.c LGPL video/decode/hw_d3d11va.c LGPL video/decode/hw_dxva2.c LGPL diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 38776b32b9..a8340dc409 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -27,6 +27,8 @@ Interface changes - drop the internal "mp-rawvideo" codec (used by --demuxer=rawvideo) - rename --sub-ass-style-override to --sub-ass-override, and rename the `--sub-ass-override=signfs` setting to `--sub-ass-override=scale`. + - change default of --video-aspect-method to "bitstream". The "hybrid" + method (old default) is deprecated. --- mpv 0.25.0 --- - remove opengl-cb dxva2 dummy hwdec interop (see git "vo_opengl: remove dxva2 dummy hwdec backend") diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 4d2be6ad66..080bf73582 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -823,12 +823,13 @@ Video :hybrid: Prefer the container aspect ratio. If the bitstream aspect switches mid-stream, switch to preferring the bitstream aspect. - This is the default behavior in mpv and mplayer2. + 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. :bitstream: Strictly prefer the bitstream aspect ratio, unless the bitstream aspect ratio is not set. This is apparently the default behavior - with XBMC/kodi, at least with Matroska. + with XBMC/kodi, at least with Matroska, and the current default + for mpv. Normally you should not set this. Try the ``container`` and ``bitstream`` choices if you encounter video that has the wrong aspect ratio in mpv, diff --git a/options/options.c b/options/options.c index 90cbe61d6f..38af34219b 100644 --- a/options/options.c +++ b/options/options.c @@ -943,6 +943,7 @@ const struct MPOpts mp_default_opts = { .playback_speed = 1., .pitch_correction = 1, .movie_aspect = -1., + .aspect_method = 1, .field_dominance = -1, .sub_auto = 0, .audiofile_auto = -1, diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index 5231fad240..bd20dbe312 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -13,6 +13,10 @@ * * You should have received a copy of the GNU General Public License along * with mpv. If not, see . + * + * Almost LGPL. + * + * Parts under HAVE_GPL are licensed under GNU General Public License forever. */ #include @@ -197,12 +201,16 @@ 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) { @@ -212,8 +220,14 @@ static void fix_image_params(struct dec_video *d_video, use_container = false; } break; +#else + /* fall through, behave as "bitstream" */ +#endif case 1: - use_container = false; + if (dec_aspect) { + MP_VERBOSE(d_video, "Using bitstream aspect ratio.\n"); + use_container = false; + } break; } @@ -300,12 +314,14 @@ static bool receive_frame(struct dec_video *d_video, struct mp_image **out_image if (!mpi) return progress; +#if HAVE_GPL if (opts->field_dominance == 0) { mpi->fields |= MP_IMGFIELD_TOP_FIRST | MP_IMGFIELD_INTERLACED; } else if (opts->field_dominance == 1) { mpi->fields &= ~MP_IMGFIELD_TOP_FIRST; mpi->fields |= MP_IMGFIELD_INTERLACED; } +#endif // Note: the PTS is reordered, but the DTS is not. Both should be monotonic. double pts = mpi->pts; diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index 5ef1f9252a..8d1936e016 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -13,6 +13,8 @@ * * You should have received a copy of the GNU General Public License along * with mpv. If not, see . + * + * Almost LGPL. */ #ifndef MPLAYER_DEC_VIDEO_H