Update mpv to 0.35.0

https://raw.githubusercontent.com/mpv-player/mpv/master/RELEASE_NOTES

Update diff from Brad
This commit is contained in:
rsadowski 2022-11-17 06:46:46 +00:00
parent b303726578
commit 73e7e11eb9
9 changed files with 25 additions and 437 deletions

View File

@ -2,17 +2,15 @@ COMMENT = movie player based on MPlayer/mplayer2
GH_ACCOUNT = mpv-player
GH_PROJECT = mpv
GH_TAGNAME = v0.34.1
GH_TAGNAME = v0.35.0
REVISION = 2
SHARED_LIBS += mpv 0.2 # 1.109
SHARED_LIBS += mpv 1.0 # 2.0
CATEGORIES = multimedia x11
HOMEPAGE = https://mpv.io/
WAF = ${WRKSRC}/waf-2.0.20
WAF = ${WRKSRC}/waf-2.0.24
MASTER_SITES0 = https://waf.io/
DISTFILES = ${GH_DISTFILE} ${WAF:T}:0
EXTRACT_ONLY = ${DISTNAME}${EXTRACT_SUFX}
@ -20,7 +18,7 @@ EXTRACT_ONLY = ${DISTNAME}${EXTRACT_SUFX}
# GPLv2+
PERMIT_PACKAGE = Yes
WANTLIB += EGL GL SDL2 X11 X11-xcb Xau Xdmcp Xext Xfixes Xinerama
WANTLIB += EGL GL SDL2 X11 X11-xcb Xau Xdmcp Xext Xfixes Xinerama Xpresent
WANTLIB += Xrandr Xrender Xss Xv Xxf86vm archive ass avcodec avdevice
WANTLIB += avfilter avformat avresample avutil bluray c cdio cdio_cdda
WANTLIB += cdio_paranoia drm dvdnav dvdread epoxy expat fontconfig
@ -77,6 +75,7 @@ CONFIGURE_ARGS = --confloaddir=${SYSCONFDIR}/mpv \
--disable-rubberband \
--disable-openal \
--disable-optimize \
--disable-pipewire \
--disable-pulse \
--disable-sixel \
--disable-sdl2-audio \
@ -91,11 +90,11 @@ CONFIGURE_ARGS = --confloaddir=${SYSCONFDIR}/mpv \
--disable-vdpau-gl-x11 \
--disable-videotoolbox-gl \
--disable-vulkan \
--disable-wayland-scanner \
--disable-wayland-protocols
--disable-wayland
MAKE_ENV = CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" \
LIBmpv_VERSION=${LIBmpv_VERSION}
MAKE_FLAGS = -o "${WRKBUILD}" -t "${WRKSRC}" --destdir="${DESTDIR}"
NO_TEST = Yes
@ -103,15 +102,11 @@ NO_TEST = Yes
DO_WAF = cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MODPY_BIN} \
${WAF} ${MAKE_FLAGS}
LMAJ = ${LIBmpv_VERSION:R}
LMIN = ${LIBmpv_VERSION:E}
UPDATE_PLIST_ARGS += -i LMAJ -i LMIN
SUBST_VARS += LMAJ \
LMIN
SUBST_VARS += LIBmpv_VERSION
post-patch:
cp ${DISTDIR}/${WAF:T} ${WAF}
${SUBST_CMD} ${WRKSRC}/libmpv/client.h
${SUBST_CMD} ${WRKSRC}/wscript_build.py
do-configure:
${DO_WAF} configure ${CONFIGURE_ARGS}

View File

@ -1,4 +1,4 @@
SHA256 (mpv-0.34.1.tar.gz) = Mt7YwTtjmDEPondnN4GT3B2214sAa3Dby9MSOhRF50Y=
SHA256 (waf-2.0.20) = v5cemO3CQUloomLGqmuIVBomw80khonIn0xXNwlV7n8=
SIZE (mpv-0.34.1.tar.gz) = 3288356
SIZE (waf-2.0.20) = 104725
SHA256 (mpv-0.35.0.tar.gz) = 3EEciZpkVIJQwUK/H6GqdSjxtDmKJMhrgWCTmZBJ7AA=
SHA256 (waf-2.0.24) = k5CbyoI6Z1+fQK98ZbJIh8OjwO/fQR/xl4uoJxlL3rA=
SIZE (mpv-0.35.0.tar.gz) = 3365752
SIZE (waf-2.0.24) = 105408

View File

@ -1,19 +0,0 @@
ao_sndio: add this audio output again
https://github.com/mpv-player/mpv/pull/8314
Index: DOCS/man/ao.rst
--- DOCS/man/ao.rst.orig
+++ DOCS/man/ao.rst
@@ -219,5 +219,11 @@ Available audio output drivers are:
``no-waveheader`` option - with ``waveheader`` it's broken, because
it will write a WAVE header every time the file is opened.
+``sndio``
+ Audio output to the OpenBSD sndio sound system
+
+ (Note: only supports mono, stereo, 4.0, 5.1 and 7.1 channel
+ layouts.)
+
``wasapi``
Audio output to the Windows Audio Session API.

View File

@ -1,25 +0,0 @@
Another attempt to return ao_sndio to mpv
https://github.com/mpv-player/mpv/pull/9298
Index: audio/out/ao.c
--- audio/out/ao.c.orig
+++ audio/out/ao.c
@@ -41,6 +41,7 @@ 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_rsound;
+extern const struct ao_driver audio_out_sndio;
extern const struct ao_driver audio_out_pulse;
extern const struct ao_driver audio_out_jack;
extern const struct ao_driver audio_out_openal;
@@ -87,6 +88,9 @@ static const struct ao_driver * const audio_out_driver
#endif
#if HAVE_SDL2_AUDIO
&audio_out_sdl,
+#endif
+#if HAVE_SNDIO
+ &audio_out_sndio,
#endif
&audio_out_null,
#if HAVE_COREAUDIO

View File

@ -1,326 +0,0 @@
Another attempt to return ao_sndio to mpv
https://github.com/mpv-player/mpv/pull/9298
Index: audio/out/ao_sndio.c
--- audio/out/ao_sndio.c.orig
+++ audio/out/ao_sndio.c
@@ -0,0 +1,318 @@
+/*
+ * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
+ * Copyright (c) 2013 Christian Neukirchen <chneukirchen@gmail.com>
+ * Copyright (c) 2020 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * Copyright (c) 2021 Andrew Krasavin <noiseless-ak@yandex.ru>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "config.h"
+
+#include <sys/types.h>
+#include <poll.h>
+#include <errno.h>
+#include <sndio.h>
+
+#include "options/m_option.h"
+#include "common/msg.h"
+
+#include "audio/format.h"
+#include "ao.h"
+#include "internal.h"
+
+struct priv {
+ struct sio_hdl *hdl;
+ struct sio_par par;
+ int delay;
+ bool playing;
+ int vol;
+ int havevol;
+ struct pollfd *pfd;
+};
+
+
+static const struct mp_chmap sndio_layouts[] = {
+ {0}, /* empty */
+ {1, {MP_SPEAKER_ID_FL}}, /* mono */
+ MP_CHMAP2(FL, FR), /* stereo */
+ {0}, /* 2.1 */
+ MP_CHMAP4(FL, FR, BL, BR), /* 4.0 */
+ {0}, /* 5.0 */
+ MP_CHMAP6(FL, FR, BL, BR, FC, LFE), /* 5.1 */
+ {0}, /* 6.1 */
+ MP_CHMAP8(FL, FR, BL, BR, FC, LFE, SL, SR), /* 7.1 */
+ /* Above is the fixed channel assignment for sndio, since we need to
+ * fill all channels and cannot insert silence, not all layouts are
+ * supported.
+ * NOTE: MP_SPEAKER_ID_NA could be used to add padding channels. */
+};
+
+static void uninit(struct ao *ao);
+
+
+/* Make libsndio call movecb(). */
+static void process_events(struct ao *ao)
+{
+ struct priv *p = ao->priv;
+
+ int n = sio_pollfd(p->hdl, p->pfd, POLLOUT);
+ while (poll(p->pfd, n, 0) < 0 && errno == EINTR);
+
+ sio_revents(p->hdl, p->pfd);
+}
+
+/* Call-back invoked to notify of the hardware position. */
+static void movecb(void *addr, int delta)
+{
+ struct ao *ao = addr;
+ struct priv *p = ao->priv;
+
+ p->delay -= delta;
+}
+
+/* Call-back invoked to notify about volume changes. */
+static void volcb(void *addr, unsigned newvol)
+{
+ struct ao *ao = addr;
+ struct priv *p = ao->priv;
+
+ p->vol = newvol;
+}
+
+static int init(struct ao *ao)
+{
+ struct priv *p = ao->priv;
+ struct mp_chmap_sel sel = {0};
+ size_t i;
+ struct af_to_par {
+ int format, bits, sig;
+ };
+ static const struct af_to_par af_to_par[] = {
+ {AF_FORMAT_U8, 8, 0},
+ {AF_FORMAT_S16, 16, 1},
+ {AF_FORMAT_S32, 32, 1},
+ };
+ const struct af_to_par *ap;
+ const char *device = ((ao->device) ? ao->device : SIO_DEVANY);
+
+ /* Opening device. */
+ MP_VERBOSE(ao, "Using '%s' audio device.\n", device);
+ p->hdl = sio_open(device, SIO_PLAY, 0);
+ if (p->hdl == NULL) {
+ MP_ERR(ao, "Can't open audio device %s.\n", device);
+ goto err_out;
+ }
+
+ sio_initpar(&p->par);
+
+ /* Selecting sound format. */
+ ao->format = af_fmt_from_planar(ao->format);
+
+ p->par.bits = 16;
+ p->par.sig = 1;
+ p->par.le = SIO_LE_NATIVE;
+ for (i = 0; i < MP_ARRAY_SIZE(af_to_par); i++) {
+ ap = &af_to_par[i];
+ if (ap->format == ao->format) {
+ p->par.bits = ap->bits;
+ p->par.sig = ap->sig;
+ break;
+ }
+ }
+
+ p->par.rate = ao->samplerate;
+
+ /* Channels count. */
+ for (i = 0; i < MP_ARRAY_SIZE(sndio_layouts); i++) {
+ mp_chmap_sel_add_map(&sel, &sndio_layouts[i]);
+ }
+ if (!ao_chmap_sel_adjust(ao, &sel, &ao->channels))
+ goto err_out;
+
+ p->par.pchan = ao->channels.num;
+ p->par.appbufsz = p->par.rate * 250 / 1000; /* 250ms buffer */
+ p->par.round = p->par.rate * 10 / 1000; /* 10ms block size */
+
+ if (!sio_setpar(p->hdl, &p->par)) {
+ MP_ERR(ao, "couldn't set params\n");
+ goto err_out;
+ }
+
+ /* Get current sound params. */
+ if (!sio_getpar(p->hdl, &p->par)) {
+ MP_ERR(ao, "couldn't get params\n");
+ goto err_out;
+ }
+ if (p->par.bps > 1 && p->par.le != SIO_LE_NATIVE) {
+ MP_ERR(ao, "swapped endian output not supported\n");
+ goto err_out;
+ }
+
+ /* Update sound params. */
+ if (p->par.bits == 8 && p->par.bps == 1 && !p->par.sig) {
+ ao->format = AF_FORMAT_U8;
+ } else if (p->par.bits == 16 && p->par.bps == 2 && p->par.sig) {
+ ao->format = AF_FORMAT_S16;
+ } else if ((p->par.bits == 32 || p->par.msb) && p->par.bps == 4 && p->par.sig) {
+ ao->format = AF_FORMAT_S32;
+ } else {
+ MP_ERR(ao, "couldn't set format\n");
+ goto err_out;
+ }
+
+ p->havevol = sio_onvol(p->hdl, volcb, ao);
+ sio_onmove(p->hdl, movecb, ao);
+
+ p->pfd = talloc_array_ptrtype(p, p->pfd, sio_nfds(p->hdl));
+ if (!p->pfd)
+ goto err_out;
+
+ ao->device_buffer = p->par.bufsz;
+ MP_VERBOSE(ao, "bufsz = %i, appbufsz = %i, round = %i\n",
+ p->par.bufsz, p->par.appbufsz, p->par.round);
+
+ p->delay = 0;
+ p->playing = false;
+ if (!sio_start(p->hdl)) {
+ MP_ERR(ao, "start: sio_start() fail.\n");
+ goto err_out;
+ }
+
+ return 0;
+
+err_out:
+ uninit(ao);
+ return -1;
+}
+
+static void uninit(struct ao *ao)
+{
+ struct priv *p = ao->priv;
+
+ if (p->hdl) {
+ sio_close(p->hdl);
+ p->hdl = NULL;
+ }
+ p->pfd = NULL;
+ p->playing = false;
+}
+
+static int control(struct ao *ao, enum aocontrol cmd, void *arg)
+{
+ struct priv *p = ao->priv;
+ ao_control_vol_t *vol = arg;
+
+ switch (cmd) {
+ case AOCONTROL_GET_VOLUME:
+ if (!p->havevol)
+ return CONTROL_FALSE;
+ vol->left = vol->right = p->vol * 100 / SIO_MAXVOL;
+ break;
+ case AOCONTROL_SET_VOLUME:
+ if (!p->havevol)
+ return CONTROL_FALSE;
+ sio_setvol(p->hdl, vol->left * SIO_MAXVOL / 100);
+ break;
+ default:
+ return CONTROL_UNKNOWN;
+ }
+ return CONTROL_OK;
+}
+
+static void reset(struct ao *ao)
+{
+ struct priv *p = ao->priv;
+
+ if (p->playing) {
+ p->playing = false;
+
+ if (!sio_flush(p->hdl)) {
+ MP_ERR(ao, "reset: couldn't sio_flush()\n");
+ }
+ p->delay = 0;
+ if (!sio_start(p->hdl)) {
+ MP_ERR(ao, "reset: sio_start() fail.\n");
+ }
+ }
+}
+
+static void start(struct ao *ao)
+{
+ struct priv *p = ao->priv;
+
+ p->playing = true;
+ process_events(ao);
+}
+
+static bool audio_write(struct ao *ao, void **data, int samples)
+{
+ struct priv *p = ao->priv;
+ const size_t size = (samples * ao->sstride);
+ size_t rc;
+
+ rc = sio_write(p->hdl, data[0], size);
+ if (rc != size) {
+ MP_WARN(ao, "audio_write: unexpected partial write: required: %zu, written: %zu.\n",
+ size, rc);
+ reset(ao);
+ p->playing = false;
+ return false;
+ }
+ p->delay += samples;
+
+ return true;
+}
+
+static void get_state(struct ao *ao, struct mp_pcm_state *state)
+{
+ struct priv *p = ao->priv;
+
+ process_events(ao);
+
+ /* how many samples we can play without blocking */
+ state->free_samples = ao->device_buffer - p->delay;
+ state->free_samples = state->free_samples / p->par.round * p->par.round;
+ /* how many samples are already in the buffer to be played */
+ state->queued_samples = p->delay;
+ /* delay in seconds between first and last sample in buffer */
+ state->delay = p->delay / (double)p->par.rate;
+
+ /* report unexpected EOF / underrun */
+ if (state->queued_samples && state->queued_samples &&
+ state->queued_samples < state->free_samples &&
+ p->playing || sio_eof(p->hdl))
+ {
+ MP_VERBOSE(ao, "get_state: EOF/underrun detected.\n");
+ MP_VERBOSE(ao, "get_state: free: %d, queued: %d, delay: %lf\n", \
+ state->free_samples, state->queued_samples, state->delay);
+ p->playing = false;
+ state->playing = p->playing;
+ ao_wakeup_playthread(ao);
+ } else {
+ state->playing = p->playing;
+ }
+}
+
+const struct ao_driver audio_out_sndio = {
+ .name = "sndio",
+ .description = "sndio audio output",
+ .init = init,
+ .uninit = uninit,
+ .control = control,
+ .reset = reset,
+ .start = start,
+ .write = audio_write,
+ .get_state = get_state,
+ .priv_size = sizeof(struct priv),
+};

View File

@ -1,14 +0,0 @@
Set shared library version.
Index: libmpv/client.h
--- libmpv/client.h.orig
+++ libmpv/client.h
@@ -235,7 +235,7 @@ extern "C" {
* relational operators (<, >, <=, >=).
*/
#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
-#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 109)
+#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(${LMAJ}, ${LMIN})
/**
* The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before

View File

@ -1,19 +0,0 @@
Another attempt to return ao_sndio to mpv
https://github.com/mpv-player/mpv/pull/9298
Index: wscript
--- wscript.orig
+++ wscript
@@ -435,6 +435,11 @@ audio_output_features = [
'func': check_statement(['sys/soundcard.h'], 'int x = SNDCTL_DSP_SETPLAYVOL'),
'deps': 'posix && gpl',
}, {
+ 'name': '--sndio',
+ 'desc': 'sndio audio input/output',
+ 'func': check_pkg_config('sndio'),
+ 'default': 'disable'
+ }, {
'name': '--pulse',
'desc': 'PulseAudio audio output',
'func': check_pkg_config('libpulse', '>= 1.0')

View File

@ -1,15 +1,12 @@
Another attempt to return ao_sndio to mpv
https://github.com/mpv-player/mpv/pull/9298
Index: wscript_build.py
--- wscript_build.py.orig
+++ wscript_build.py
@@ -248,6 +248,7 @@ def build(ctx):
( "audio/out/ao_pcm.c" ),
( "audio/out/ao_pulse.c", "pulse" ),
( "audio/out/ao_sdl.c", "sdl2-audio" ),
+ ( "audio/out/ao_sndio.c", "sndio" ),
( "audio/out/ao_wasapi.c", "wasapi" ),
( "audio/out/ao_wasapi_changenotify.c", "wasapi" ),
( "audio/out/ao_wasapi_utils.c", "wasapi" ),
@@ -673,7 +673,7 @@ def build(ctx):
vre = '#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION\((.*), (.*)\)'
libmpv_header = ctx.path.find_node("libmpv/client.h").read()
major, minor = re.search(vre, libmpv_header).groups()
- libversion = major + '.' + minor + '.0'
+ libversion = '${LIBmpv_VERSION}' + '.0'
def _build_libmpv(shared):
features = "c "

View File

@ -1,7 +1,6 @@
@bin bin/mpv
include/mpv/
include/mpv/client.h
include/mpv/opengl_cb.h
include/mpv/render.h
include/mpv/render_gl.h
include/mpv/stream_cb.h
@ -26,6 +25,6 @@ share/icons/hicolor/scalable/apps/mpv.svg
share/icons/hicolor/symbolic/apps/mpv-symbolic.svg
@tag gtk-update-icon-cache %D/share/icons/hicolor
@tag update-desktop-database
share/zsh/
share/zsh/site-functions/
share/metainfo/
share/metainfo/mpv.metainfo.xml
share/zsh/site-functions/_mpv