.gear/mpv.spec | 392 +++++++++++++++++++++ .gear/rules | 3 + .../tags/3996724d3fa1c51cc7998f3de2e22e2c99e6d270 | 23 ++ .gear/tags/list | 1 + common/encode_lavc.c | 1 + common/msg.c | 3 +- player/video.c | 8 +- video/image_writer.c | 4 +- video/out/opengl/context_drm_egl.c | 9 +- video/out/wayland_common.c | 15 +- video/zimg.c | 9 +- 11 files changed, 454 insertions(+), 14 deletions(-) diff --git a/.gear/mpv.spec b/.gear/mpv.spec new file mode 100644 index 0000000000..9440c1f4a3 --- /dev/null +++ b/.gear/mpv.spec @@ -0,0 +1,392 @@ +%ifarch %luajit_arches +%def_enable lua +%endif + +Name: mpv +Version: 0.36.0 +Release: alt1.2 + +Summary: mpv is a free and open-source general-purpose video player based on MPlayer and mplayer2. +License: GPLv2+ +Group: Video + +Url: http://mpv.io/ +Source: %name-%version.tar +Patch: %name-%version-alt.patch + +Packager: %packager + +# for %%luajit_arches macro +BuildRequires(pre): rpm-macros-luajit +BuildRequires(pre): meson ninja-build + +# Automatically added by buildreq on Fri Feb 14 2014 +BuildRequires: libGL-devel libXext-devel libalsa-devel libass-devel libavformat-devel libjpeg-devel libswscale-devel zlib-devel libva-devel + +BuildRequires: libpulseaudio-devel libXScrnSaver-devel libXv-devel libXinerama-devel libXrandr-devel libdvdnav-devel libbluray-devel libavfilter-devel + +BuildRequires: libswresample-devel libxkbcommon-devel libdrm-devel libv4l-devel libarchive-devel liblcms2-devel libjack-devel + +BuildRequires: libenca-devel libuchardet-devel libvulkan-devel libwayland-egl-devel libwayland-cursor-devel libwayland-client-devel wayland-protocols python3-base + +BuildRequires: libgbm-devel libplacebo-devel libSDL2-devel libavdevice-devel libXpresent-devel + +BuildRequires: libzimg-devel vapoursynth-devel libshaderc-devel nv-codec-headers pipewire-libs-devel libsixel-devel + +BuildRequires: /usr/bin/rst2man + +%if_enabled lua +BuildRequires: liblua5.1-devel libluajit-devel +%endif + +Summary(ru_RU.UTF-8): MPV - это медиапроигрыватель с открытыми исходниками, основанный на проектах MPlayer и mplayer2. + +%description +mpv is a movie player based on MPlayer and mplayer2. +It supports a wide variety of video file formats, +audio and video codecs, and subtitle types. + +%description -l ru_RU.UTF-8 +mpv - это медиапроигрыватель, основанный на проектах +MPlayer и mplayer2. Он поддерживает большое количество +видеоформатов, аудио и видео кодеков и форматов субтитров. + +%package -n zsh-completion-%name +Summary: Zsh completion for %name +Group: Shells +BuildArch: noarch +Requires: %name = %version-%release + +%description -n zsh-completion-%name +Zsh completion for %name. + +%package -n bash-completion-%name +Summary: Bash completion for %name +Group: Shells +BuildArch: noarch +Requires: bash-completion +Requires: %name = %version-%release + +%description -n bash-completion-%name +Bash completion for %name. + +%package -n libmpv-devel +Summary: Header files for %name +Group: Development/C +Requires: %name = %version-%release + +%description -n libmpv-devel +Header files for %name + +%package -n libmpv2 +Summary: %name shared library +Group: System/Libraries + +%description -n libmpv2 +This package contains %name shared library + +%prep +%setup -n %name-%version +%patch -p1 + +%build +%meson \ + -D pulse=enabled \ + -D xv=enabled \ + -D vaapi=enabled \ + -D alsa=enabled \ + -D gl-x11=enabled \ +%if_enabled lua + -D lua=enabled \ +%endif + -D libbluray=enabled \ + -D dvdnav=enabled \ + -D libmpv=true \ + -D jack=enabled \ + -D vulkan=enabled \ + -D sdl2=enabled \ + -D vapoursynth=enabled \ + -D pipewire=enabled + +%meson_build -v + +%install +%meson_install + +rm -rfv %buildroot/share/ +rm -rfv %buildroot%_iconsdir/hicolor/symbolic/ + +%files +%dir %_sysconfdir/%name +%config %_sysconfdir/%name/encoding-profiles.conf +%_bindir/%name +%_man1dir/%name.1.* +%_miconsdir/%name.png +%_niconsdir/%name.png +%_iconsdir/hicolor/64x64/apps/%name.png +%_iconsdir/hicolor/128x128/apps/%name.png +%_iconsdir/hicolor/scalable/apps/%name.svg +%_desktopdir/%name.desktop +%doc Copyright README.md RELEASE_NOTES etc/input.conf etc/mplayer-input.conf etc/mpv.conf etc/restore-old-bindings.conf + +%files -n zsh-completion-%name +%_datadir/zsh/site-functions/_mpv + +%files -n bash-completion-%name +%_datadir/bash-completion/completions/* + +%files -n libmpv-devel +%_libdir/libmpv.so +%_includedir/%name +%_pkgconfigdir/*.pc + +%files -n libmpv2 +%_libdir/libmpv.so.* + +%changelog +* Thu Sep 14 2023 L.A. Kostis 0.36.0-alt1.2 +- Apply fix from master branch: + + context_drm_egl: don't free egl properties if they are null (closes #47577) + +* Tue Aug 29 2023 L.A. Kostis 0.36.0-alt1.1 +- Rebuild w/ new ffmpeg. +- BR: remove libavresample (obsoleted). + +* Thu Jul 27 2023 L.A. Kostis 0.36.0-alt1 +- 0.36.0. +- switch to meson. +- Apply fixes from master branch: + + player/video: check for track and decoder existence + + video_writer: fix gamma for YUV screenshots + + encode_lavc: fix leak of codecpar + + zimg: fix abort on subsampled input with odd heights + + msg: print MSGL_WARN and higher error messages to stderr + + wayland: restore xkb_keysym_to_utf8 handling + +* Mon Jul 17 2023 L.A. Kostis 0.35.1-alt4 +- Apply fixes for libplacebo v6.265+ compatibility: + + vo_gpu_next: compatibility with libplacebo v6.265 + + vo_gpu_next: compatibility with PL_API_VER >= 254 + + hwdec_cuda: drop support for PL_HANDLE_WIN32_KMT + + hwdec_cuda: remove usage of deprecated libplacebo sync API +- Apply some fixes from master: + + vo_gpu_next: don't flush cache on OSD update + + demux/demux_lavf: avoid leaking AVFormatContext during demux_open_lavf + + ffmpeg: update to handle deprecation of `av_init_packet` + + demux: replace deprecated usage of stack allocated AVPackets + +* Fri May 26 2023 L.A. Kostis 0.35.1-alt3 +- BR: remove libsmb (smb support removed by upstream). + +* Wed Mar 29 2023 L.A. Kostis 0.35.1-alt2 +- added sixel support. + +* Thu Feb 09 2023 L.A. Kostis 0.35.1-alt1 +- 0.35.1. + +* Sat Nov 12 2022 L.A. Kostis 0.35.0-alt1 +- 0.35.0. +- enable pipewire support. +- BR: added libXpresent-devel (for xpresent support). +- libmpv: bump soname. + +* Mon Oct 03 2022 L.A. Kostis 0.34.1-alt2 +- BR: added nv-codec-headers (for CUDA support). + +* Mon Jun 06 2022 Leontiy Volodin 0.34.1-alt1 +- 0.34.1. +- Fix build with python3-module-docutils. + +* Tue Nov 16 2021 L.A. Kostis 0.34.0-alt2 +- use shaderc. + +* Fri Nov 12 2021 L.A. Kostis 0.34.0-alt1 +- 0.34.0. + +* Sun Aug 15 2021 Vitaly Lipatov 0.33.1-alt3 +- NMU: drop unused BR, use /usr/bin/rst2man.py + +* Mon Jun 14 2021 L.A. Kostis 0.33.1-alt2 +- Apply build fix for new libplacebo. + +* Tue Jun 01 2021 Leontiy Volodin 0.33.1-alt1 +- 0.33.1. +- Fixes: + + CVE-2021-30145. + +* Mon Jan 25 2021 Leontiy Volodin 0.33.0-alt2 +- Added vapoursynth and libzimg support. + +* Tue Nov 24 2020 L.A. Kostis 0.33.0-alt1.1 +- Add libspirv-cross-devel to BR. +- Add missing libavdevice-devel to BR (should fix v4l). + +* Mon Nov 23 2020 L.A. Kostis 0.33.0-alt1 +- 0.33.0. +- remove buggy libsmbclient. +- waf: use python3. +- add bash-completition package. + +* Mon Jul 20 2020 L.A. Kostis 0.32.0-alt1 +- 0.32.0. +- Enabled support: + + vulkan + + SDL2 + + gbm (for drm output) + +* Mon Jul 20 2020 L.A. Kostis 0.29.1-alt10 +- Added vulkan vo. +- Fix wayland support. + +* Mon Jul 20 2020 L.A. Kostis 0.29.1-alt9.1 +- Don't exit on fail ABI check (complete a fix from ALT#37106). + +* Thu Jul 16 2020 Terechkov Evgenii 0.29.1-alt9 +- Cherry-pick commit from lakostis@ (ALT#37106) + +* Tue Mar 31 2020 Vitaly Lipatov 0.29.1-alt8 +- NMU: add BR: libuchardet to fix auto guess of subtitle encoding +- NMU: fix unpacked files + +* Sun Mar 1 2020 Terechkov Evgenii 0.29.1-alt7 +- Fix FTBFS (replace bin/python -> bin/python2 in waf.py) + +* Fri Oct 11 2019 Terechkov Evgenii 0.29.1-alt6 +- Build with JACK support (ALT#37324) + +* Sat Jun 29 2019 Michael Shigorin 0.29.1-alt5 +- Fix build with older libEGL, see upstream issue #5599 + (commit taken from NetBSD) +- Minor spec cleanup + +* Fri Apr 12 2019 Gleb F-Malinovskiy 0.29.1-alt4 +- Use %%luajit_arches macro to disable lua support on architectures + unsupported by luajit. + +* Tue Feb 26 2019 Terechkov Evgenii 0.29.1-alt3 +- Rebuild without libass5 + +* Fri Nov 9 2018 Terechkov Evgenii 0.29.1-alt2 +- Rebuild with new ffmpeg + +* Thu Nov 1 2018 Terechkov Evgenii 0.29.1-alt1 +- 0.29.1 + +* Wed Oct 31 2018 Michael Shigorin 0.28.2-alt3 +- Replace e2k arch name with %%e2k macro (grenka@) + +* Sun Sep 9 2018 Terechkov Evgenii 0.28.2-alt2 +- Build with TV/V4L support (ALT#35370) + +* Thu Jun 14 2018 Anton Farygin 0.28.2-alt1 +- 0.28.2 + +* Mon Feb 12 2018 Vladimir D. Seleznev 0.27.1-alt1 +- 0.27.1 +- Fixes: + + CVE-2018-6360 + +* Wed Sep 20 2017 Michael Shigorin 0.27.0-alt2 +- E2K: avoid lua for luajit (not ported yet) + +* Wed Sep 13 2017 Terechkov Evgenii 0.27.0-alt1 +- 0.27.0 + +* Sat Jun 03 2017 Anton Farygin 0.25.0-alt2 +- rebuild with debuginfo-enabled ffmpeg + +* Sat Jun 03 2017 Anton Farygin 0.25.0-alt1 +- 0.25.0 +- enabled wayland, v4l, egl, drm and libarchive support + +* Sun Jan 29 2017 Terechkov Evgenii 0.22.0-alt2 +- Fix build + +* Tue Nov 22 2016 Terechkov Evgenii 0.22.0-alt1 +- 0.22.0 + +* Fri Oct 21 2016 Terechkov Evgenii 0.21.0-alt1 +- 0.21.0 + +* Tue Aug 16 2016 Terechkov Evgenii 0.19.0-alt1 +- 0.19.0 (ALT#32382) + +* Sat Mar 12 2016 Terechkov Evgenii 0.16.0-alt2 +- Build libmpv as shared library (ALT#31876) + +* Mon Mar 7 2016 Terechkov Evgenii 0.16.0-alt1 +- 0.16.0 + +* Sat Jan 30 2016 Terechkov Evgenii 0.15.0-alt1 +- 0.15.0 + +* Thu Nov 12 2015 Terechkov Evgenii 0.13.0-alt1 +- 0.13.0 + +* Sun Nov 8 2015 Terechkov Evgenii 0.12.0-alt1 +- 0.12.0 + +* Fri Oct 9 2015 Terechkov Evgenii 0.11.0-alt1 +- 0.11.0 (ALT #31345) + +* Mon May 25 2015 Terechkov Evgenii 0.9.2-alt1 +- 0.9.2 + +* Mon Apr 27 2015 Terechkov Evgenii 0.9.0-alt1 +- 0.9.0 + +* Wed Apr 1 2015 Terechkov Evgenii 0.8.3-alt2 +- Build with Samba (ALT #30889) + +* Sun Mar 29 2015 Terechkov Evgenii 0.8.3-alt1 +- 0.8.3 +- Enable dvdnav/bluray/avfilter (ALT #30873) +- Enable Zsh completion subpackage (ALT #30874) + +* Sat Feb 21 2015 Terechkov Evgenii 0.8.0-alt1 +- 0.8.0 + +* Sun Feb 8 2015 Terechkov Evgenii 0.7.3-alt1 +- 0.7.3 +- Build from upstream git +- Spec cleanup + +* Sun Jan 11 2015 Terechkov Evgenii 0.7.2-alt1 +- Version update + +* Sat Dec 20 2014 Andrey Bergman 0.7.1-alt1 +- Version update. Added VAAPI support. + +* Thu Nov 13 2014 Andrey Bergman 0.6.2-alt1.1 +- Added examples. + +* Thu Nov 13 2014 Andrey Bergman 0.6.2-alt1 +- Version update. + +* Wed Oct 08 2014 Andrey Bergman 0.6.0-alt1 +- Version update. + +* Tue Sep 16 2014 Andrey Bergman 0.5.3-alt1.1 +- Rebuild. + +* Tue Sep 16 2014 Andrey Bergman 0.5.3-alt1 +- Version update. + +* Mon Jun 23 2014 Andrey Bergman 0.3.11-alt1 +- Version update. + +* Sat Apr 05 2014 Andrey Bergman 0.3.7-alt1.1 +- Added docdir ownership. + +* Sat Apr 05 2014 Andrey Bergman 0.3.7-alt1 +- Version update. + +* Fri Feb 14 2014 Andrey Bergman 0.3.5-alt1.2 +- Enabled support for libass and libquvi. + +* Fri Feb 14 2014 Andrey Bergman 0.3.5-alt1.1 +- Removed intersections with system packages. + +* Fri Feb 14 2014 Andrey Bergman 0.3.5-alt1 +- Inital build for Sisyphus. + diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000000..c3230cb56c --- /dev/null +++ b/.gear/rules @@ -0,0 +1,3 @@ +tar: v@version@:. +diff: v@version@:. . name=@name@-@version@-alt.patch +spec: .gear/mpv.spec diff --git a/.gear/tags/3996724d3fa1c51cc7998f3de2e22e2c99e6d270 b/.gear/tags/3996724d3fa1c51cc7998f3de2e22e2c99e6d270 new file mode 100644 index 0000000000..c59de23481 --- /dev/null +++ b/.gear/tags/3996724d3fa1c51cc7998f3de2e22e2c99e6d270 @@ -0,0 +1,23 @@ +object f4210f84906c3b00a65fba198c8127b6757b9350 +type commit +tag v0.36.0 +tagger sfan5 1690132243 +0200 + +Release 0.36.0 +-----BEGIN PGP SIGNATURE----- + +iQJCBAABCAAsFiEEFFB32CUBqiAVLKzOjXaSCNXjFBkFAmS9XxMOHHNmYW41QGxp +dmUuZGUACgkQjXaSCNXjFBn4Tw//UMq/dMh/GbQmFY7KC7H6VgbPxrCfpzmSumVl +WIMmQhjvNwMTxW5CpQLoPsYb93aFwo3SDWJdckc9tmikTSi8DECliF3ypNyG0fXt +FJZ4vZ6W/8xr/WuJyndpIQUMtKfbM7lj8cQRB5FDmiTzYUzcZ9Ph0J/cdvjvB9m+ +4SWedpZEQZMTBfweQgdJXf/3mbZGOuz3gJdenu79EBQFBPvpKEx3uuBE50h9TAHM +3v+WfCArie5Qj4t7vhvoWusrP3GL63OPnMzy+Mr+yPeKB0tad0iRwdLPbTA0O29Q +1KCFVIpQAjLR1LTnvrvD/wRNycaf7QHK8Xs5PYNu8Wg2O+mwbehgte/J4OY11VGK +jTiCTJ8PXjSmC34i/5u/jyv2hICU406EwiISw+DEh9HEBGWJnER1RwxyhdlzWL8p +bG+esPPgOJzt3nEA4rChmw4TXZvKqATd53AJOWn+H8ee75AV2JGILJSht9xZ2Tkc +WTwBsIsbLZFKkJtomr+SmD68RrfKUCv3Df9BBQ0TQ5RQMY0m86cLkRaLZ+NPweF2 +ZiJmSSjkpR2i8Ihnhz1+rZSrsxV5LolnTOR9CVgHk4XxwlbUKi1aYtZ5NZfmrKGG +oUFGbq/RKi2BY/+3vB8/XDKRE5I+9N1b5W+f/ZjOhmPhdmdm/gbFJwcfx0IW+Wge +WuWx6jE= +=n2kB +-----END PGP SIGNATURE----- diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 0000000000..a3ac44e5b2 --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +3996724d3fa1c51cc7998f3de2e22e2c99e6d270 v0.36.0 diff --git a/common/encode_lavc.c b/common/encode_lavc.c index 7a9a20a517..6da6796034 100644 --- a/common/encode_lavc.c +++ b/common/encode_lavc.c @@ -731,6 +731,7 @@ static void encoder_destroy(void *ptr) struct encoder_context *p = ptr; av_packet_free(&p->pkt); + avcodec_parameters_free(&p->info.codecpar); avcodec_free_context(&p->encoder); free_stream(p->twopass_bytebuffer); } diff --git a/common/msg.c b/common/msg.c index 8e5ad26a11..d1128c71bd 100644 --- a/common/msg.c +++ b/common/msg.c @@ -306,7 +306,8 @@ static void print_terminal_line(struct mp_log *log, int lev, return; struct mp_log_root *root = log->root; - FILE *stream = (root->force_stderr || lev == MSGL_STATUS) ? stderr : stdout; + FILE *stream = (root->force_stderr || lev == MSGL_STATUS || lev == MSGL_FATAL || + lev == MSGL_ERR || lev == MSGL_WARN) ? stderr : stdout; if (lev != MSGL_STATUS) flush_status_line(root); diff --git a/player/video.c b/player/video.c index 0161929c46..2f084d90c4 100644 --- a/player/video.c +++ b/player/video.c @@ -562,7 +562,7 @@ static bool check_for_hwdec_fallback(struct MPContext *mpctx) { struct vo_chain *vo_c = mpctx->vo_chain; - if (!vo_c->filter->failed_output_conversion || !vo_c->track) + if (!vo_c->filter->failed_output_conversion || !vo_c->track || !vo_c->track->dec) return false; if (mp_decoder_wrapper_control(vo_c->track->dec, @@ -576,9 +576,13 @@ static bool check_for_hwdec_fallback(struct MPContext *mpctx) static bool check_for_forced_eof(struct MPContext *mpctx) { struct vo_chain *vo_c = mpctx->vo_chain; - struct mp_decoder_wrapper *dec = vo_c->track->dec; + if (!vo_c->track || !vo_c->track->dec) + return false; + + struct mp_decoder_wrapper *dec = vo_c->track->dec; bool forced_eof = false; + mp_decoder_wrapper_control(dec, VDCTRL_CHECK_FORCED_EOF, &forced_eof); return forced_eof; } diff --git a/video/image_writer.c b/video/image_writer.c index 81a696e5d3..7ac1c179fc 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -633,9 +633,9 @@ static struct mp_image *convert_image(struct mp_image *image, int destfmt, mp_image_params_guess_csp(&p); if (!image_writer_flexible_csp(opts)) { - // Formats that don't support non-sRGB csps should be forced to sRGB + // If our format can't tag csps, set something sane p.color.primaries = MP_CSP_PRIM_BT_709; - p.color.gamma = MP_CSP_TRC_SRGB; + p.color.gamma = MP_CSP_TRC_AUTO; p.color.light = MP_CSP_LIGHT_DISPLAY; p.color.sig_peak = 0; if (p.color.space != MP_CSP_RGB) { diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c index abd3e99c3b..b59e8dde81 100644 --- a/video/out/opengl/context_drm_egl.c +++ b/video/out/opengl/context_drm_egl.c @@ -497,9 +497,12 @@ static void drm_egl_uninit(struct ra_ctx *ctx) eglMakeCurrent(p->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - eglDestroyContext(p->egl.display, p->egl.context); - eglDestroySurface(p->egl.display, p->egl.surface); - gbm_surface_destroy(p->gbm.surface); + if (p->egl.display) { + eglDestroyContext(p->egl.display, p->egl.context); + eglDestroySurface(p->egl.display, p->egl.surface); + } + if (p->gbm.surface) + gbm_surface_destroy(p->gbm.surface); eglTerminate(p->egl.display); gbm_device_destroy(p->gbm.device); p->egl.context = EGL_NO_CONTEXT; diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 799dad543f..2e6722c8c2 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -436,15 +436,20 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard, xkb_keysym_t sym = xkb_state_key_get_one_sym(wl->xkb_state, wl->keyboard_code); int mpkey = lookupkey(sym); - // Assume a modifier was pressed and handle it in the mod event instead. - if (!mpkey && MP_KEY_STATE_DOWN) - return; - state = state == WL_KEYBOARD_KEY_STATE_PRESSED ? MP_KEY_STATE_DOWN : MP_KEY_STATE_UP; - if (mpkey) + if (mpkey) { mp_input_put_key(wl->vo->input_ctx, mpkey | state | wl->mpmod); + } else { + char s[128]; + if (xkb_keysym_to_utf8(sym, s, sizeof(s)) > 0) { + mp_input_put_key_utf8(wl->vo->input_ctx, state | wl->mpmod, bstr0(s)); + } else { + // Assume a modifier was pressed and handle it in the mod event instead. + return; + } + } if (state == MP_KEY_STATE_DOWN) wl->mpkey = mpkey; if (wl->mpkey == mpkey && state == MP_KEY_STATE_UP) diff --git a/video/zimg.c b/video/zimg.c index c3560a0ff7..be2953c58c 100644 --- a/video/zimg.c +++ b/video/zimg.c @@ -268,7 +268,14 @@ static bool wrap_buffer(struct mp_zimg_state *st, struct mp_zimg_repack *r, if (r->pack) { mpi = &r->cropped_tmp; *mpi = *a_mpi; - mp_image_crop(mpi, 0, st->slice_y, mpi->w, st->slice_y + st->slice_h); + int y1 = st->slice_y + st->slice_h; + // Due to subsampling we may assume the image to be bigger than it + // actually is (see real_h in setup_format). + if (mpi->h < y1) { + assert(y1 - mpi->h < 4); + mp_image_set_size(mpi, mpi->w, y1); + } + mp_image_crop(mpi, 0, st->slice_y, mpi->w, y1); } bool direct[MP_MAX_PLANES] = {0};