summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleot <leot@pkgsrc.org>2020-12-19 11:27:51 +0000
committerleot <leot@pkgsrc.org>2020-12-19 11:27:51 +0000
commite4c59151b030f805e3ababf460b30b7bb1fc6e5b (patch)
tree802c688a3e3693bc56c42da6b2e4ce13ea9345f3
parenteadbaf7995ae3c39d83f4d86c1a401d5367711da (diff)
downloadpkgsrc-e4c59151b030f805e3ababf460b30b7bb1fc6e5b.tar.gz
mpv: Update to 0.33.0
pkgsrc changes: - Remove `ass' option: libass is now always needed and enabled - Add `openal' option to enable openal ao (disabled by default) - Remove pkgsrc patches ao-s that were removed in 0.33.0 (a possible patch for oss ao is under discussion upstream: https://github.com/mpv-player/mpv/pull/8312 ) Changes: 0.33.0 ====== Features -------- Added ~~~~~ - scripting: load scripts from directories - mac: activate logging when started from the bundle - ytdl_hook.lua: delay load subtitles - sub: add an option to filter subtitles by regex - scripting: add a way to run subprocesses as "scripts" - command: implement asynchronous commands and support for named arguments - player: add optional separate video decoding thread - vo_gpu: d3d11: add support for exclusive fullscreen - w32_common: Support HiDPI on Windows - vo_x11: add 10 bit support - vo_gpu: add BT.2390 tone-mapping - client API: add software rendering API - audio: add scaletempo2 filter based on chromium - auto_profiles: add this script - stream: Implement slice:// for reading slices of streams - player: add automatic loading of external cover art files - vo_sixel: implement terminal video output using sixel Changed ~~~~~~~ - sws_utils: use zimg by default if available - build: pick up Lua 5.2 by default (preferred over 5.1) - build: disable RPI vendor blob auto-detection in favor of open-source stack - build: make C11 atomics mandatory - build: make libass non-optional - player: stricter filename matching for external subtitle auto-loading - lua: support Unicode paths in script loading and IO library - vo_direct3d: rip out texture video rendering path and dumb down OSD rendering - audio: rewrite internal audio handling and AO API - build: disable GLX by default Removed ~~~~~~~ - stream_libarchive: disable tar support due to bugs - Remove remains of Libav compatibility - stream_smb: remove due to lack of thread safety and the abundance of alternatives, FFmpeg still includes SMB support - command: remove legacy hook API (has been deprecated for a long time) - client API: remove deprecated qthelper.hpp header - removed audio outputs: sndio, rsound, oss - x11: remove xdg-screensaver invocations that supported dbus based idle inhibit - client API: deactivate the opengl_cb API - build system: drop Python 2 compatbility Options and Commands -------------------- Added ~~~~~ - demux: add option to disable cache "sharing" between back and forward buffers - player: add ab-loop-count option/property - ytdl_hook: add a way to use ytdl's default formats - ytdl_hook: add all_formats option that loads all formats that were found - demux_mkv: document probe-start-time option and enable it by default - command: extend osd-overlay command with bounds reporting - player: a number of new playlist contol commands/properties - ipc: add --input-ipc-client option - options: add option to control display-sync factor - vo_gpu: add better gamut clipping option - vo_gpu: vulkan: add ability to disable events - x11: add option to make window appear on a specific workspace - wayland: expose wayland-app-id as a user option - player: add --subs-with-matching-audio option - command: add read-only focused property - screenshot: option to use software rendering for screenshots - command: add delete-watch-later-config - command: new property mouse-pos with current position and hover state Changed ~~~~~~~ - options: remove deprecation warning for "-foo bar" syntax - player: make audio hr-seek default - ad_lavc: disable decoder downmix by default - command: support save-position-on-quit for "stop" command too - command: extend subprocess command - options: do not accept ":" as separator anymore in key/value lists Deprecated ~~~~~~~~~~ - demux: deprecate --cache-secs Removed ~~~~~~~ - wayland: remove wayland-frame-wait-offset option - input: remove deprecated --input-file option - vo_vdpau: remove deprecated/inactive --vo-vdpau-deint option Fixes and Minor Enhancements ---------------------------- - options: stop hiding deprecated options from --help output - lua, js: add mp.get_script_directory() function - lua: fix security relevant loading order issue with scripts - player: make screenshot each-frame mode more accurate - bash completion: complete ao/af/vo/vf options - zimg: add alpha support - wayland: make resizing better - edl: add mechanism for delay loading streams - stream_file: fix caching-related performance regression on CIFS - cocoa-cb: fix crashes and issues with UI updates - sub, demux: improve behavior with negative subtitle delay/muxed subs - demux: make seek ranges work for static images + audio - cocoa-cb: support maximize/minimize on startup - umpv: change from legacy FIFO to socket - stats: move input speed to cache page, make it a graph - stats: add fourth page with performance graphs - command: print edition title to OSD when cycling - zimg: add support for big endian input and output - demux_mkv: add png intra support - build: detect VT_GETMODE on FreeBSD and DragonFly - win32: use windows 10 native virtual-terminal if available - vo_gpu: enable frame caching for still frames - command: add property to return text subtitles in ASS - vo_gpu: ra_pl: add timers support - build: allow vo_wlshm on more Wayland platforms (e.g. FreeBSD) - zimg: add slice threading and use it by default - command: add a way to access properties of a current track - vo_gpu: EGL: fix transparency on X11/EGL/Mesa - vd_lavc: add AV1 to the default allowed hwdec codec list
-rw-r--r--multimedia/mpv/Makefile14
-rw-r--r--multimedia/mpv/PLIST6
-rw-r--r--multimedia/mpv/distinfo22
-rw-r--r--multimedia/mpv/options.mk29
-rw-r--r--multimedia/mpv/patches/patch-DOCS_man_ao.rst16
-rw-r--r--multimedia/mpv/patches/patch-audio_out_ao.c24
-rw-r--r--multimedia/mpv/patches/patch-audio_out_ao__netbsd.c275
-rw-r--r--multimedia/mpv/patches/patch-options_options.c20
-rw-r--r--multimedia/mpv/patches/patch-player_main.c26
-rw-r--r--multimedia/mpv/patches/patch-video_out_drm__common.c21
-rw-r--r--multimedia/mpv/patches/patch-video_out_wayland__common.c8
-rw-r--r--multimedia/mpv/patches/patch-wscript30
-rw-r--r--multimedia/mpv/patches/patch-wscript__build.py14
13 files changed, 50 insertions, 455 deletions
diff --git a/multimedia/mpv/Makefile b/multimedia/mpv/Makefile
index 4a3c360c4bc..a1c25bfd080 100644
--- a/multimedia/mpv/Makefile
+++ b/multimedia/mpv/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.117 2020/11/06 12:30:16 nia Exp $
+# $NetBSD: Makefile,v 1.118 2020/12/19 11:27:51 leot Exp $
-DISTNAME= mpv-0.32.0
-PKGREVISION= 18
+DISTNAME= mpv-0.33.0
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_GITHUB:=mpv-player/}
GITHUB_TAG= v${PKGVERSION_NOREV}
@@ -34,12 +33,6 @@ CONF_FILES+= share/examples/mpv/encoding-profiles.conf ${PKG_SYSCONFDIR}/mpv/en
PKGCONFIG_OVERRIDE+= libmpv/mpv.pc.in
-SUBST_CLASSES+= audio
-SUBST_SED.audio+= -e "s,/dev/dsp,${DEVOSSAUDIO},"
-SUBST_FILES.audio+= audio/out/ao_oss.c
-SUBST_STAGE.audio= pre-configure
-SUBST_MESSAGE.audio= Fixing path to audio device.
-
SUBST_CLASSES+= python
SUBST_SED.python+= -e "s,python,python${PYVERSSUFFIX},"
SUBST_SED.python+= -e "s,rst2man,rst2man-${PYVERSSUFFIX},"
@@ -71,13 +64,12 @@ post-install:
.include "options.mk"
-LDFLAGS.NetBSD+= -lossaudio
-.include "../../mk/oss.buildlink3.mk"
.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/waf/waf.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/lcms2/buildlink3.mk"
.include "../../lang/python/application.mk"
+.include "../../multimedia/libass/buildlink3.mk"
.include "../../multimedia/libdvdnav/buildlink3.mk"
.include "../../multimedia/ffmpeg4/buildlink3.mk"
.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
diff --git a/multimedia/mpv/PLIST b/multimedia/mpv/PLIST
index bd4a4e1744a..0e4f955be89 100644
--- a/multimedia/mpv/PLIST
+++ b/multimedia/mpv/PLIST
@@ -1,14 +1,13 @@
-@comment $NetBSD: PLIST,v 1.10 2020/06/05 03:52:23 ryoon Exp $
+@comment $NetBSD: PLIST,v 1.11 2020/12/19 11:27:51 leot Exp $
bin/mpv
include/mpv/client.h
include/mpv/opengl_cb.h
-include/mpv/qthelper.hpp
include/mpv/render.h
include/mpv/render_gl.h
include/mpv/stream_cb.h
lib/libmpv.so
lib/libmpv.so.1
-lib/libmpv.so.1.107.0
+lib/libmpv.so.1.109.0
lib/pkgconfig/mpv.pc
man/man1/mpv.1
share/applications/mpv.desktop
@@ -18,6 +17,7 @@ share/doc/mpv/mplayer-input.conf
share/doc/mpv/mpv.conf
share/doc/mpv/restore-old-bindings.conf
share/examples/mpv/encoding-profiles.conf
+share/icons/hicolor/128x128/apps/mpv.png
share/icons/hicolor/16x16/apps/mpv.png
share/icons/hicolor/32x32/apps/mpv.png
share/icons/hicolor/64x64/apps/mpv.png
diff --git a/multimedia/mpv/distinfo b/multimedia/mpv/distinfo
index b4020341e08..002c38258f7 100644
--- a/multimedia/mpv/distinfo
+++ b/multimedia/mpv/distinfo
@@ -1,16 +1,10 @@
-$NetBSD: distinfo,v 1.67 2020/04/16 04:17:54 nia Exp $
+$NetBSD: distinfo,v 1.68 2020/12/19 11:27:51 leot Exp $
-SHA1 (mpv-0.32.0.tar.gz) = 5b69ea34dd5f8d209acd5266415c7bc00ab83341
-RMD160 (mpv-0.32.0.tar.gz) = d1e399fce8985a0399fe627248b87d8537cfefd7
-SHA512 (mpv-0.32.0.tar.gz) = f6426c0254ec0bf2f120e2196904f1e15fe17032b06764abca1d5e074f0cabb452eaf1cd09f8fd9b25b591accee7b881bfc3b06c19d5c98980305c4712486bd6
-Size (mpv-0.32.0.tar.gz) = 3148730 bytes
-SHA1 (patch-DOCS_man_ao.rst) = 5940fe1ad4d4328c03b9e6e5265c517762cfe2d0
-SHA1 (patch-audio_out_ao.c) = 1527c818d0f50801485ad3b90c5d86b30b2ca6f1
+SHA1 (mpv-0.33.0.tar.gz) = 62ba4778773624546aeb039bb39c33b7a21579f9
+RMD160 (mpv-0.33.0.tar.gz) = 4b5201454365d1fa2dc0c1b3350f227b056d0758
+SHA512 (mpv-0.33.0.tar.gz) = 5a4af74ba2c9656c6b61adcf944c734923c7b4527a49cd79ec63a0617911629438a138d887dfbd4b6c0c9c53e2c68c18839d98d9765179e52cc5675d0682e077
+Size (mpv-0.33.0.tar.gz) = 3259387 bytes
SHA1 (patch-audio_out_ao__alsa.c) = c4661d0d22550d6e4eb2b7a42dd04dbcc58123b0
-SHA1 (patch-audio_out_ao__netbsd.c) = 94549be09bec15afc08dbe132880334b3140d4a1
-SHA1 (patch-options_options.c) = c75fb27140ad21e0a11c6ded976116c544661f56
-SHA1 (patch-player_main.c) = 7d1d62091c327fca698844004ddb9a7871e15fce
-SHA1 (patch-video_out_drm__common.c) = a545a8aec29f1b3c44d26aacbc59b86d3333a0b9
-SHA1 (patch-video_out_wayland__common.c) = d3e72c4ff5426bd8349c15679a47d446c35666b1
-SHA1 (patch-wscript) = cc3f24fcd10a23fef81bad149bfb88bf7d2a117c
-SHA1 (patch-wscript__build.py) = bbb391be46f6e5c02d1946a07bb5d8bbb442fd5a
+SHA1 (patch-video_out_drm__common.c) = 70eb8884f63e9456c0ffe592289cfd81e208955b
+SHA1 (patch-video_out_wayland__common.c) = 6a8d1d9b4109f941847f7eef47e3fbc7b3cc0535
+SHA1 (patch-wscript) = f9b3f85c696d70ca4becb5f554320f754779c0de
diff --git a/multimedia/mpv/options.mk b/multimedia/mpv/options.mk
index 115ce26add2..a107567476d 100644
--- a/multimedia/mpv/options.mk
+++ b/multimedia/mpv/options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.25 2020/06/30 14:30:38 nia Exp $
+# $NetBSD: options.mk,v 1.26 2020/12/19 11:27:51 leot Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.mpv
@@ -7,15 +7,15 @@ PKG_OPTIONS_OPTIONAL_GROUPS= gl
PKG_OPTIONS_GROUP.gl= opengl rpi
# audio outputs
-PKG_SUPPORTED_OPTIONS+= alsa jack pulseaudio
+PKG_SUPPORTED_OPTIONS+= alsa jack openal pulseaudio
# video outputs
PKG_SUPPORTED_OPTIONS+= caca libdrm wayland x11
# audio/video outputs
PKG_SUPPORTED_OPTIONS+= sdl2
# misc
-PKG_SUPPORTED_OPTIONS+= ass bluray lua
+PKG_SUPPORTED_OPTIONS+= bluray lua
-PKG_SUGGESTED_OPTIONS= ass bluray lua sdl2
+PKG_SUGGESTED_OPTIONS= bluray lua sdl2
PKG_SUGGESTED_OPTIONS.Linux+= alsa pulseaudio
.include "../../mk/bsd.fast.prefs.mk"
@@ -97,6 +97,17 @@ WAF_CONFIGURE_ARGS+= --enable-jack
WAF_CONFIGURE_ARGS+= --disable-jack
.endif
+
+###
+### OpenAL support (audio output)
+###
+.if !empty(PKG_OPTIONS:Mopenal)
+WAF_CONFIGURE_ARGS+= --enable-openal
+.include "../../audio/openal-soft/buildlink3.mk"
+.else
+WAF_CONFIGURE_ARGS+= --disable-openal
+.endif
+
###
### PulseAudio support (audio output)
###
@@ -118,16 +129,6 @@ WAF_CONFIGURE_ARGS+= --disable-sdl2
.endif
###
-### libASS support
-###
-.if !empty(PKG_OPTIONS:Mass)
-WAF_CONFIGURE_ARGS+= --enable-libass
-.include "../../multimedia/libass/buildlink3.mk"
-.else
-WAF_CONFIGURE_ARGS+= --disable-libass
-.endif
-
-###
### VAAPI support (video output)
###
.if !empty(PKG_OPTIONS:Mvaapi)
diff --git a/multimedia/mpv/patches/patch-DOCS_man_ao.rst b/multimedia/mpv/patches/patch-DOCS_man_ao.rst
deleted file mode 100644
index b13d334bd2f..00000000000
--- a/multimedia/mpv/patches/patch-DOCS_man_ao.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-DOCS_man_ao.rst,v 1.1 2020/03/16 20:31:44 nia Exp $
-
-NetBSD audio support.
-
---- DOCS/man/ao.rst.orig 2020-01-26 20:31:54.000000000 +0000
-+++ DOCS/man/ao.rst
-@@ -177,6 +177,9 @@ Available audio output drivers are:
- Sets the number of extra audio buffers in mpv. Usually needs not be
- changed.
-
-+``netbsd``
-+ Audio output to the NetBSD sound system
-+
- ``null``
- Produces no audio output but maintains video playback speed. You can use
- ``--ao=null --ao-null-untimed`` for benchmarking.
diff --git a/multimedia/mpv/patches/patch-audio_out_ao.c b/multimedia/mpv/patches/patch-audio_out_ao.c
deleted file mode 100644
index 3f82fd73fc7..00000000000
--- a/multimedia/mpv/patches/patch-audio_out_ao.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-audio_out_ao.c,v 1.1 2020/03/16 20:31:44 nia Exp $
-
-NetBSD audio support.
-
---- audio/out/ao.c.orig 2020-01-26 20:31:54.000000000 +0000
-+++ audio/out/ao.c
-@@ -40,6 +40,7 @@ extern const struct ao_driver audio_out_
- extern const struct ao_driver audio_out_audiounit;
- extern const struct ao_driver audio_out_coreaudio;
- extern const struct ao_driver audio_out_coreaudio_exclusive;
-+extern const struct ao_driver audio_out_netbsd;
- extern const struct ao_driver audio_out_rsound;
- extern const struct ao_driver audio_out_sndio;
- extern const struct ao_driver audio_out_pulse;
-@@ -64,6 +65,9 @@ static const struct ao_driver * const au
- #if HAVE_COREAUDIO
- &audio_out_coreaudio,
- #endif
-+#if HAVE_NETBSD_AUDIO
-+ &audio_out_netbsd,
-+#endif
- #if HAVE_PULSE
- &audio_out_pulse,
- #endif
diff --git a/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c b/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c
deleted file mode 100644
index 7de4dc2cfd8..00000000000
--- a/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c
+++ /dev/null
@@ -1,275 +0,0 @@
-$NetBSD: patch-audio_out_ao__netbsd.c,v 1.7 2020/04/16 04:17:55 nia Exp $
-
-NetBSD audio support.
-
---- audio/out/ao_netbsd.c.orig 2020-04-16 04:14:21.934246800 +0000
-+++ audio/out/ao_netbsd.c
-@@ -0,0 +1,268 @@
-+/*
-+ * Copyright (c) 2020 Nia Alarie <nia@NetBSD.org>
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-+ * POSSIBILITY OF SUCH DAMAGE.
-+ */
-+#include <sys/audioio.h>
-+#include <sys/ioctl.h>
-+#include <unistd.h>
-+#include <fcntl.h>
-+#include <errno.h>
-+#include <stdint.h>
-+#include <string.h>
-+
-+#include "options/m_option.h"
-+#include "common/msg.h"
-+
-+#include "audio/format.h"
-+#include "ao.h"
-+#include "internal.h"
-+
-+#ifndef NETBSD_MAX_CHANNELS
-+#define NETBSD_MAX_CHANNELS (12)
-+#endif
-+
-+#ifndef NETBSD_MAX_DEVS
-+#define NETBSD_MAX_DEVS (8)
-+#endif
-+
-+struct priv {
-+ int fd;
-+};
-+
-+static int init(struct ao *ao)
-+{
-+ char device[16] = "/dev/audio";
-+ struct priv *p = ao->priv;
-+ struct audio_info info;
-+ struct audio_info hw_info;
-+ struct audio_prinfo *pinfo;
-+ struct mp_chmap_sel sel = {0};
-+
-+ AUDIO_INITINFO(&info);
-+ AUDIO_INITINFO(&hw_info);
-+ pinfo = &info.play;
-+
-+ if (ao->device != NULL) {
-+ (void)snprintf(device, sizeof(device), "/dev/audio%s",
-+ ao->device + sizeof("netbsd/") - 1);
-+ }
-+
-+ MP_ERR(ao, "Opening device %s\n", device);
-+ if ((p->fd = open(device, O_WRONLY | O_NONBLOCK)) == -1) {
-+ MP_ERR(ao, "Can't open audio device %s: %s\n",
-+ device, mp_strerror(errno));
-+ goto fail;
-+ }
-+
-+#ifdef AUDIO_GETFORMAT
-+ if (ioctl(p->fd, AUDIO_GETFORMAT, &hw_info) == -1) {
-+ MP_ERR(ao, "AUDIO_GETFORMAT failed: %s\n", mp_strerror(errno));
-+ goto fail;
-+ }
-+#else
-+ hw_info.play.sample_rate = 48000;
-+#endif
-+
-+ info.mode = AUMODE_PLAY;
-+
-+ for (int n = 1; n <= NETBSD_MAX_CHANNELS; n++) {
-+ struct mp_chmap map;
-+
-+ mp_chmap_from_channels(&map, n);
-+ mp_chmap_sel_add_map(&sel, &map);
-+ }
-+
-+ if (!ao_chmap_sel_adjust(ao, &sel, &ao->channels)) {
-+ MP_ERR(ao, "Failed to select a valid channel map\n");
-+ goto fail;
-+ }
-+
-+ pinfo->channels = ao->channels.num;
-+ pinfo->sample_rate = ao->samplerate = hw_info.play.sample_rate;
-+
-+ switch (ao->format) {
-+ case AF_FORMAT_U8:
-+ pinfo->precision = 8;
-+ pinfo->encoding = AUDIO_ENCODING_ULINEAR;
-+ break;
-+ case AF_FORMAT_S16:
-+ pinfo->precision = 16;
-+ pinfo->encoding = AUDIO_ENCODING_SLINEAR;
-+ break;
-+ default:
-+ pinfo->precision = 32;
-+ pinfo->encoding = AUDIO_ENCODING_SLINEAR;
-+ ao->format = AF_FORMAT_S32;
-+ break;
-+ }
-+
-+ if (ioctl(p->fd, AUDIO_SETINFO, &info) == -1) {
-+ MP_ERR(ao, "AUDIO_SETINFO failed: %s\n", mp_strerror(errno));
-+ goto fail;
-+ }
-+
-+ if (ioctl(p->fd, AUDIO_GETINFO, &info) == -1) {
-+ MP_ERR(ao, "AUDIO_GETINFO failed: %s\n", mp_strerror(errno));
-+ goto fail;
-+ }
-+
-+ ao->period_size = info.blocksize / (pinfo->precision / 8) / pinfo->channels;
-+ ao->device_buffer = info.play.buffer_size / (pinfo->precision / 8) / pinfo->channels;
-+
-+ return 0;
-+
-+fail:
-+ if (p->fd != -1) {
-+ close(p->fd);
-+ }
-+ return -1;
-+}
-+
-+static void uninit(struct ao *ao)
-+{
-+ struct priv *p = ao->priv;
-+
-+ (void)ioctl(p->fd, AUDIO_FLUSH, NULL);
-+ (void)close(p->fd);
-+ p->fd = -1;
-+}
-+
-+static void reset(struct ao *ao)
-+{
-+ struct priv *p = ao->priv;
-+
-+ (void)ioctl(p->fd, AUDIO_FLUSH, NULL);
-+}
-+
-+static void drain(struct ao *ao)
-+{
-+ struct priv *p = ao->priv;
-+
-+ (void)ioctl(p->fd, AUDIO_DRAIN, NULL);
-+}
-+
-+static int get_space(struct ao *ao)
-+{
-+ struct priv *p = ao->priv;
-+ struct audio_info info;
-+ unsigned int nblk;
-+
-+ if (ioctl(p->fd, AUDIO_GETBUFINFO, &info) == -1) {
-+ MP_ERR(ao, "AUDIO_GETBUFINFO failed: %s\n", mp_strerror(errno));
-+ return 0;
-+ }
-+ nblk = info.hiwat - (info.play.seek / info.blocksize);
-+ return nblk * ao->period_size;
-+}
-+
-+static void audio_pause(struct ao *ao)
-+{
-+ struct priv *p = ao->priv;
-+ struct audio_info info;
-+
-+ if (ioctl(p->fd, AUDIO_GETINFO, &info) == -1) {
-+ MP_ERR(ao, "AUDIO_GETINFO failed: %s\n", mp_strerror(errno));
-+ return;
-+ }
-+ info.play.pause = 1;
-+ (void)ioctl(p->fd, AUDIO_SETINFO, &info);
-+}
-+
-+static void audio_resume(struct ao *ao)
-+{
-+ struct priv *p = ao->priv;
-+ struct audio_info info;
-+
-+ if (ioctl(p->fd, AUDIO_GETINFO, &info) == -1) {
-+ MP_ERR(ao, "AUDIO_GETINFO failed: %s\n", mp_strerror(errno));
-+ return;
-+ }
-+ info.play.pause = 0;
-+ (void)ioctl(p->fd, AUDIO_SETINFO, &info);
-+ reset(ao);
-+}
-+
-+static double get_delay(struct ao *ao)
-+{
-+ struct priv *p = ao->priv;
-+ struct audio_info info;
-+
-+ if (ioctl(p->fd, AUDIO_GETBUFINFO, &info) == -1) {
-+ MP_ERR(ao, "AUDIO_GETBUFINFO failed: %s\n", mp_strerror(errno));
-+ return 0;
-+ }
-+ return (info.blocksize + info.play.seek) / (double)ao->bps;
-+}
-+
-+static int play(struct ao *ao, void **data, int samples, int flags)
-+{
-+ struct priv *p = ao->priv;
-+ int len = samples * ao->sstride;
-+ int ret;
-+
-+ if (len == 0)
-+ return 0;
-+
-+ errno = 0;
-+ if ((ret = write(p->fd, data[0], len)) == -1) {
-+ MP_ERR(ao, "audio write failed: %s\n", mp_strerror(errno));
-+ return 0;
-+ }
-+ return ret / ao->sstride;
-+}
-+
-+static void list_devs(struct ao *ao, struct ao_device_list *list)
-+{
-+ char name[16];
-+ struct audio_device dev;
-+ int fd;
-+
-+ for (int i = 0; 0 < NETBSD_MAX_DEVS; ++i) {
-+ (void)snprintf(name, sizeof(name), "/dev/audio%d", i);
-+ fd = open(name, O_WRONLY);
-+ if (fd == -1 || ioctl(fd, AUDIO_GETDEV, &dev) == -1) {
-+ break;
-+ }
-+ (void)snprintf(name, sizeof(name), "%d", i);
-+ ao_device_list_add(list, ao, &(struct ao_device_desc){name, dev.name});
-+ close(fd);
-+ }
-+}
-+
-+const struct ao_driver audio_out_netbsd = {
-+ .description = "NetBSD audio output",
-+ .name = "netbsd",
-+ .init = init,
-+ .uninit = uninit,
-+ .reset = reset,
-+ .drain = drain,
-+ .pause = audio_pause,
-+ .resume = audio_resume,
-+ .get_space = get_space,
-+ .get_delay = get_delay,
-+ .play = play,
-+ .list_devs = list_devs,
-+ .priv_size = sizeof(struct priv),
-+};
diff --git a/multimedia/mpv/patches/patch-options_options.c b/multimedia/mpv/patches/patch-options_options.c
deleted file mode 100644
index 424a72319f4..00000000000
--- a/multimedia/mpv/patches/patch-options_options.c
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-options_options.c,v 1.3 2020/03/16 20:31:44 nia Exp $
-
-Workaround for frame drops with a high default blocksize.
-Can be removed when we are blk_ms=4 everywhere.
-
-PR kern/54230
-
---- options/options.c.orig 2019-12-28 11:07:07.000000000 +0000
-+++ options/options.c
-@@ -992,6 +992,10 @@ static const struct MPOpts mp_default_op
- },
-
- .cuda_device = -1,
-+
-+#ifdef __NetBSD__
-+ .autosync = 30,
-+#endif
- };
-
- const struct m_sub_options mp_opt_root = {
diff --git a/multimedia/mpv/patches/patch-player_main.c b/multimedia/mpv/patches/patch-player_main.c
deleted file mode 100644
index bc2188c41d5..00000000000
--- a/multimedia/mpv/patches/patch-player_main.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-player_main.c,v 1.6 2019/12/28 17:20:33 leot Exp $
-
-Avoid to check mismatched built vs running libraries version.
-The use in pkgsrc can be considered a legitimate one.
-
---- player/main.c.orig 2019-12-28 11:07:07.000000000 +0000
-+++ player/main.c
-@@ -387,18 +387,6 @@ int mp_initialize(struct MPContext *mpct
- if (handle_help_options(mpctx))
- return 1; // help
-
-- if (!print_libav_versions(mp_null_log, 0)) {
-- // This happens only if the runtime FFmpeg version is lower than the
-- // build version, which will not work according to FFmpeg's ABI rules.
-- // This does not happen if runtime FFmpeg is newer, which is compatible.
-- print_libav_versions(mpctx->log, MSGL_FATAL);
-- MP_FATAL(mpctx, "\nmpv was compiled against an incompatible version of "
-- "FFmpeg/Libav than the shared\nlibrary it is linked against. "
-- "This is most likely a broken build and could\nresult in "
-- "misbehavior and crashes.\n\nThis is a broken build.\n");
-- return -1;
-- }
--
- #if HAVE_TESTS
- if (opts->test_mode && opts->test_mode[0])
- return run_tests(mpctx) ? 1 : -1;
diff --git a/multimedia/mpv/patches/patch-video_out_drm__common.c b/multimedia/mpv/patches/patch-video_out_drm__common.c
index e567b76c4f3..02d150a067b 100644
--- a/multimedia/mpv/patches/patch-video_out_drm__common.c
+++ b/multimedia/mpv/patches/patch-video_out_drm__common.c
@@ -1,19 +1,16 @@
-$NetBSD: patch-video_out_drm__common.c,v 1.3 2019/10/25 14:35:56 leot Exp $
+$NetBSD: patch-video_out_drm__common.c,v 1.4 2020/12/19 11:27:51 leot Exp $
Enable support for DRM on NetBSD.
---- video/out/drm_common.c.orig 2019-10-25 13:08:15.000000000 +0000
+--- video/out/drm_common.c.orig 2020-11-22 17:46:28.000000000 +0000
+++ video/out/drm_common.c
-@@ -21,7 +21,12 @@
- #include <sys/ioctl.h>
- #include <poll.h>
- #include <sys/stat.h>
-+#if defined(__NetBSD__)
+@@ -30,6 +30,9 @@
+
+ #if HAVE_CONSIO_H
+ #include <sys/consio.h>
++#elif HAVE_WSDISPLAY_USL_IO_H
+#include <sys/types.h>
+#include <dev/wscons/wsdisplay_usl_io.h>
-+#else
+ #else
#include <sys/vt.h>
-+#endif
- #include <unistd.h>
- #include <limits.h>
- #include <math.h>
+ #endif
diff --git a/multimedia/mpv/patches/patch-video_out_wayland__common.c b/multimedia/mpv/patches/patch-video_out_wayland__common.c
index 197dffc512c..70b95ff4205 100644
--- a/multimedia/mpv/patches/patch-video_out_wayland__common.c
+++ b/multimedia/mpv/patches/patch-video_out_wayland__common.c
@@ -1,15 +1,15 @@
-$NetBSD: patch-video_out_wayland__common.c,v 1.4 2019/12/10 10:45:07 nia Exp $
+$NetBSD: patch-video_out_wayland__common.c,v 1.5 2020/12/19 11:27:51 leot Exp $
Allow building on systems without evdev.
---- video/out/wayland_common.c.orig 2019-10-25 13:08:15.000000000 +0000
+--- video/out/wayland_common.c.orig 2020-11-22 17:46:28.000000000 +0000
+++ video/out/wayland_common.c
@@ -19,7 +19,15 @@
#include <limits.h>
#include <poll.h>
#include <unistd.h>
-+#if defined(__linux__) || defined(__FreeBSD__)
- #include <linux/input.h>
++#ifdef HAVE_LINUX_INPUT_EVENT_CODES
+ #include <linux/input-event-codes.h>
+#else
+#define BTN_LEFT (0x110)
+#define BTN_RIGHT (0x111)
diff --git a/multimedia/mpv/patches/patch-wscript b/multimedia/mpv/patches/patch-wscript
index a9179c33da3..8ee197f1f27 100644
--- a/multimedia/mpv/patches/patch-wscript
+++ b/multimedia/mpv/patches/patch-wscript
@@ -1,13 +1,11 @@
-$NetBSD: patch-wscript,v 1.5 2020/03/16 21:20:03 wiz Exp $
+$NetBSD: patch-wscript,v 1.6 2020/12/19 11:27:51 leot Exp $
Enable support for DRM on NetBSD.
-NetBSD audio support.
-
---- wscript.orig 2020-01-26 20:31:54.000000000 +0000
+--- wscript.orig 2020-11-22 17:46:28.000000000 +0000
+++ wscript
-@@ -291,6 +291,11 @@ iconv support use --disable-iconv.",
- 'func': check_statement(['sys/vt.h', 'sys/ioctl.h'],
+@@ -268,6 +268,11 @@ iconv support use --disable-iconv.",
+ 'func': check_statement(['sys/consio.h', 'sys/ioctl.h'],
'int m; ioctl(0, VT_GETMODE, &m)'),
}, {
+ 'name': 'wsdisplay_usl_io.h',
@@ -18,24 +16,12 @@ NetBSD audio support.
'name': 'gbm.h',
'desc': 'gbm.h',
'func': check_cc(header_name=['stdio.h', 'gbm.h']),
-@@ -521,6 +526,11 @@ audio_output_features = [
- 'func': check_cc(header_name='sys/soundcard.h'),
- 'deps': 'posix && gpl',
- }, {
-+ 'name': '--netbsd-audio',
-+ 'desc': 'NetBSD audio output',
-+ 'func': check_statement(['sys/audioio.h', 'sys/ioctl.h'],
-+ 'struct audio_device d; ioctl(0, AUDIO_GETDEV, &d)'),
-+ }, {
- 'name': '--rsound',
- 'desc': 'RSound audio output',
- 'func': check_statement('rsound.h', 'rsd_init(NULL)', lib='rsound')
-@@ -587,7 +597,7 @@ video_output_features = [
+@@ -477,7 +482,7 @@ video_output_features = [
}, {
'name': '--drm',
'desc': 'DRM',
-- 'deps': 'vt.h',
-+ 'deps': 'vt.h || wsdisplay_usl_io.h',
+- 'deps': 'vt.h || consio.h',
++ 'deps': 'vt.h || consio.h || wsdisplay_usl_io.h',
'func': check_pkg_config('libdrm', '>= 2.4.74'),
}, {
- 'name': '--drmprime',
+ 'name': '--gbm',
diff --git a/multimedia/mpv/patches/patch-wscript__build.py b/multimedia/mpv/patches/patch-wscript__build.py
deleted file mode 100644
index 8de3d5bca6c..00000000000
--- a/multimedia/mpv/patches/patch-wscript__build.py
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-wscript__build.py,v 1.1 2020/03/16 20:31:44 nia Exp $
-
-NetBSD audio support.
-
---- wscript_build.py.orig 2020-01-26 20:31:54.000000000 +0000
-+++ wscript_build.py
-@@ -252,6 +252,7 @@ def build(ctx):
- ( "audio/out/ao_coreaudio_utils.c", "coreaudio || audiounit" ),
- ( "audio/out/ao_jack.c", "jack" ),
- ( "audio/out/ao_lavc.c" ),
-+ ( "audio/out/ao_netbsd.c", "netbsd-audio" ),
- ( "audio/out/ao_null.c" ),
- ( "audio/out/ao_openal.c", "openal" ),
- ( "audio/out/ao_opensles.c", "opensles" ),