Hello community,

here is the log from the commit of package mpv for openSUSE:Factory checked in 
at 2018-10-04 19:01:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mpv (Old)
 and      /work/SRC/openSUSE:Factory/.mpv.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mpv"

Thu Oct  4 19:01:06 2018 rev:48 rq:639655 version:unknown

Changes:
--------
--- /work/SRC/openSUSE:Factory/mpv/mpv.changes  2018-07-23 18:03:03.888777681 
+0200
+++ /work/SRC/openSUSE:Factory/.mpv.new/mpv.changes     2018-10-04 
19:01:09.583224430 +0200
@@ -1,0 +2,25 @@
+Tue Oct  2 20:28:39 UTC 2018 - Martin Herkt <[email protected]>
+
+- Update to version 0.29.1
+  Fixes and minor enhancements:
+  * af_rubberband: Fix for A-V drift on seeking.
+  * ao_alsa: Fixes to remove spam during pausing and end-of-file.
+  * ao_jack: Fix for mpv attempting to connect to non-standard devices such as 
MIDI.
+  * ao_openal: Drop support for Apple's bundled OpenAL due to lack of features 
to successfully build.
+  * ao_pulse: Fix for audio buffer length calculation.
+  * demux_lavf: Fix EDL playback of certain DASH streams.
+  * demux_lavf: Mark v4l streams as not seekable.
+  * demux_raw: Fix for gapless playback from raw audio input.
+  * drm_atomic: Fix to enable video output with devices without a video 
overlay plane.
+  * encode: Fix for crashes in case of failure to write to output.
+  * encode: Fix for encoding when utilizing lavfi-complex.
+  * Fix to strip HDR peak metadata if attached to SDR video (#6111)
+  * manpage: Misc fixups.
+  * stream_{smb,file}: Fix for partial writes to buffers.
+  * stream_libarchive: Fix hang when an out-of-bound seek happens.
+  * stream_smb: Fix for crashes due to libsmbclient and threading (#5936).
+  * vo_gpu: Fix for corruption when multiple compute shaders override each 
others' block sizes (#6083).
+  * ytdl_hook: Always load "ytdl://" URLs with ytdl_hook first.
+  * ytdl_hook: Fix audio streams not being picked up for some sites.
+
+-------------------------------------------------------------------

Old:
----
  mpv-0.29.0.tar.gz

New:
----
  mpv-0.29.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mpv.spec ++++++
--- /var/tmp/diff_new_pack.bHfYEu/_old  2018-10-04 19:01:10.251223729 +0200
+++ /var/tmp/diff_new_pack.bHfYEu/_new  2018-10-04 19:01:10.255223725 +0200
@@ -15,13 +15,13 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 %define _waf_ver 2.0.9
 %define _mbc_ver 3.3.17
-%define _mpv_ver 0.29.0
+%define _mpv_ver 0.29.1
 %define lname   libmpv1
 Name:           mpv
 Version:        %{_mpv_ver}

++++++ mpv-0.29.0.tar.gz -> mpv-0.29.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/.travis.yml new/mpv-0.29.1/.travis.yml
--- old/mpv-0.29.0/.travis.yml  2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/.travis.yml  2018-10-02 21:03:41.000000000 +0200
@@ -27,10 +27,12 @@
     - master
     - ci
     - coverity_scan
+    - /release\/.*$/
 
 before_install:
   - docker pull $CONTAINER
 script:
+  - ./bootstrap.py
   - docker run --env CC --env TARGET -v $TRAVIS_BUILD_DIR:/build $CONTAINER 
/bin/sh -c "cd /build && $CI_SCRIPT"
 after_failure: cat ./build/config.log
 after_script: TOOLS/travis-rebuild-website
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/DOCS/interface-changes.rst 
new/mpv-0.29.1/DOCS/interface-changes.rst
--- old/mpv-0.29.0/DOCS/interface-changes.rst   2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/DOCS/interface-changes.rst   2018-10-02 21:03:41.000000000 
+0200
@@ -19,6 +19,8 @@
 
 ::
 
+ --- mpv 0.29.1 ---
+    - add --cocoa-cb-sw-renderer to control the usage of Apple Software 
Renderer
  --- mpv 0.29.0 ---
     - drop --opensles-sample-rate, as --audio-samplerate should be used if 
desired
     - drop deprecated --videotoolbox-format, --ff-aid, --ff-vid, --ff-sid,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/DOCS/man/input.rst 
new/mpv-0.29.1/DOCS/man/input.rst
--- old/mpv-0.29.0/DOCS/man/input.rst   2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/DOCS/man/input.rst   2018-10-02 21:03:41.000000000 +0200
@@ -350,7 +350,7 @@
     Print text to stdout. The string can contain properties (see
     `Property Expansion`_).
 
-``show-text "<string>" [<duration>|- [<level>]]``
+``show-text "<string>" [<duration>|-1 [<level>]]``
     Show text on the OSD. The string can contain properties, which are expanded
     as described in `Property Expansion`_. This can be used to show playback
     time, filename, and so on.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/DOCS/man/mpv.rst 
new/mpv-0.29.1/DOCS/man/mpv.rst
--- old/mpv-0.29.0/DOCS/man/mpv.rst     2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/DOCS/man/mpv.rst     2018-10-02 21:03:41.000000000 +0200
@@ -210,11 +210,11 @@
 Alt+BACKSPACE
     Reset the pan/zoom settings.
 
-F9
+F8
     Show the playlist and the current position in it (useful only if a UI 
window
     is used, broken on the terminal).
 
-F10
+F9
     Show the list of audio and subtitle streams (useful only if a UI window  is
     used, broken on the terminal).
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/DOCS/man/options.rst 
new/mpv-0.29.1/DOCS/man/options.rst
--- old/mpv-0.29.0/DOCS/man/options.rst 2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/DOCS/man/options.rst 2018-10-02 21:03:41.000000000 +0200
@@ -540,19 +540,15 @@
 
     If the script can't do anything with an URL, it will do nothing.
 
-    The `try_ytdl_first` script option accepts a boolean 'yes' or 'no', and if
+    The ``try_ytdl_first`` script option accepts a boolean 'yes' or 'no', and 
if
     'yes' will try parsing the URL with youtube-dl first, instead of the 
default
     where it's only after mpv failed to open it. This mostly depends on whether
     most of your URLs need youtube-dl parsing.
 
-    The `exclude` script option accepts a ``|``-separated list of URL patterns
+    The ``exclude`` script option accepts a ``|``-separated list of URL 
patterns
     which mpv should not use with youtube-dl. The patterns are matched after
     the ``http(s)://`` part of the URL.
 
-    The `use_manifests` script option makes mpv use the master manifest URL for
-    formats like HLS and DASH, if available, allowing for video/audio selection
-    in runtime. It's disabled ("no") by default for performance reasons.
-
     ``^`` matches the beginning of the URL, ``$`` matches its end, and you
     should use ``%`` before any of the characters ``^$()%|,.[]*+-?`` to match
     that character.
@@ -567,6 +563,9 @@
 
     See more lua patterns here: 
https://www.lua.org/manual/5.1/manual.html#5.4.1
 
+    The ``use_manifests`` script option makes mpv use the master manifest URL 
for
+    formats like HLS and DASH, if available, allowing for video/audio selection
+    in runtime. It's disabled ("no") by default for performance reasons.
 
 ``--ytdl-format=<best|worst|mp4|webm|...>``
     Video format/quality that is directly passed to youtube-dl. The possible
@@ -4882,6 +4881,15 @@
 
     OS X only.
 
+``--cocoa-cb-sw-renderer=<yes|no|auto>``
+    Use the Apple Software Renderer when using cocoa-cb (default: auto). If set
+    to ``no`` the software renderer is never used and instead fails when a the
+    usual pixel format could not be created, ``yes`` will always only use the
+    software renderer, and ``auto`` only falls back to the software renderer
+    when the usual pixel format couldn't be created.
+
+    OS X only.
+
 ``--macos-title-bar-style=<dark|ultradark|light|mediumlight|auto>``
     Sets the styling of the title bar (default: dark).
     OS X and cocoa-cb only
@@ -5175,7 +5183,7 @@
         desaturating everything. Developed by John Hable for use in video
         games. Use this when you care about detail preservation more than
         color/brightness accuracy. This is roughly equivalent to
-        ``--hdr-tone-mapping=reinhard --tone-mapping-param=0.24``. If possible,
+        ``--tone-mapping=reinhard --tone-mapping-param=0.24``. If possible,
         you should also enable ``--hdr-compute-peak`` for the best results.
         (Default)
     gamma
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/DOCS/man/vf.rst 
new/mpv-0.29.1/DOCS/man/vf.rst
--- old/mpv-0.29.0/DOCS/man/vf.rst      2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/DOCS/man/vf.rst      2018-10-02 21:03:41.000000000 +0200
@@ -16,7 +16,7 @@
     name is an arbitrary user-given name, which identifies the filter. This
     is only needed if you want to toggle the filter at runtime.
 
-    A ``!`` before the filter name means the filter is enabled by default. It
+    A ``!`` before the filter name means the filter is disabled by default. It
     will be skipped on filter creation. This is also useful for runtime filter
     toggling.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/DOCS/man/vo.rst 
new/mpv-0.29.1/DOCS/man/vo.rst
--- old/mpv-0.29.0/DOCS/man/vo.rst      2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/DOCS/man/vo.rst      2018-10-02 21:03:41.000000000 +0200
@@ -502,7 +502,7 @@
         supports several layers) together with ``vo=gpu`` and 
``gpu-context=drm``.
         (default: first overlay plane)
 
-    ``--drm-format=<xrgb8888,xrgb2101010>``
+    ``--drm-format=<xrgb8888|xrgb2101010>``
         Select the DRM format to use (default: xrgb8888). This allows you to
         choose the bit depth of the DRM mode. xrgb8888 is your usual 24 bit per
         pixel/8 bits per channel packed RGB format with 8 bits of padding.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/RELEASE_NOTES new/mpv-0.29.1/RELEASE_NOTES
--- old/mpv-0.29.0/RELEASE_NOTES        2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/RELEASE_NOTES        2018-10-02 21:03:41.000000000 +0200
@@ -1,3 +1,44 @@
+Release 0.29.1
+==============
+
+A bug fix release for the 0.29 release branch.
+
+Fixes and Minor Enhancements
+----------------------------
+
+- af_rubberband: Fix for A-V drift on seeking.
+- ao_alsa: Fixes to remove spam during pausing and end-of-file.
+- ao_jack: Fix for mpv attempting to connect to non-standard devices such as 
MIDI.
+- ao_openal: Drop support for Apple's bundled OpenAL due to lack of features 
to successfully build.
+- ao_pulse: Fix for audio buffer length calculation.
+- demux_lavf: Fix EDL playback of certain DASH streams.
+- demux_lavf: Mark v4l streams as not seekable.
+- demux_raw: Fix for gapless playback from raw audio input.
+- drm_atomic: Fix to enable video output with devices without a video overlay 
plane.
+- encode: Fix for crashes in case of failure to write to output.
+- encode: Fix for encoding when utilizing lavfi-complex.
+- Fix to strip HDR peak metadata if attached to SDR video (#6111)
+- macOS: Capability to fall back on SW rendering for testing purposes.
+- macOS: Fix for issues with the main menu.
+- macOS: Fix for side by side split view.
+- macOS: Fixes for crashes, most notably those happening on 10.14 (#5908, 
#6097, #6041, #6062).
+- macOS: No longer let older, unsupported versions of the Swift build tools 
through configure.
+- manpage: Misc fixups.
+- stream_{smb,file}: Fix for partial writes to buffers.
+- stream_libarchive: Fix hang when an out-of-bound seek happens.
+- stream_smb: Fix for crashes due to libsmbclient and threading (#5936).
+- vo_gpu: Fix for corruption when multiple compute shaders override each 
others' block sizes (#6083).
+- ytdl_hook: Always load "ytdl://" URLs with ytdl_hook first.
+- ytdl_hook: Fix audio streams not being picked up for some sites.
+
+Options and Commands
+--------------------
+
+Added
+~~~~~
+
+- `--cocoa-cb-sw-renderer` to control whether or not to fall back on software 
rendering on macOS.
+
 Release 0.29.0
 ==============
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/VERSION new/mpv-0.29.1/VERSION
--- old/mpv-0.29.0/VERSION      2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/VERSION      2018-10-02 21:03:41.000000000 +0200
@@ -1 +1 @@
-0.29.0
+0.29.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/audio/filter/af_rubberband.c 
new/mpv-0.29.1/audio/filter/af_rubberband.c
--- old/mpv-0.29.0/audio/filter/af_rubberband.c 2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/audio/filter/af_rubberband.c 2018-10-02 21:03:41.000000000 
+0200
@@ -167,6 +167,7 @@
             if (eof) {
                 mp_pin_in_write(f->ppins[1], MP_EOF_FRAME);
                 rubberband_reset(p->rubber);
+                p->rubber_delay = 0;
                 TA_FREEP(&p->pending);
                 p->sent_final = false;
                 return;
@@ -263,6 +264,7 @@
 
     if (p->rubber)
         rubberband_reset(p->rubber);
+    p->rubber_delay = 0;
     p->sent_final = false;
     TA_FREEP(&p->pending);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/audio/format.c 
new/mpv-0.29.1/audio/format.c
--- old/mpv-0.29.0/audio/format.c       2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/audio/format.c       2018-10-02 21:03:41.000000000 +0200
@@ -55,12 +55,6 @@
     return format && !af_fmt_is_spdif(format) && !af_fmt_is_float(format);
 }
 
-// false for interleaved and AF_FORMAT_UNKNOWN
-bool af_fmt_is_planar(int format)
-{
-    return format && af_fmt_to_planar(format) == format;
-}
-
 bool af_fmt_is_spdif(int format)
 {
     return af_format_sample_alignment(format) > 1;
@@ -79,23 +73,30 @@
     {AF_FORMAT_DOUBLEP, AF_FORMAT_DOUBLE},
 };
 
+bool af_fmt_is_planar(int format)
+{
+    for (int n = 0; n < MP_ARRAY_SIZE(planar_formats); n++) {
+        if (planar_formats[n][0] == format)
+            return true;
+    }
+    return false;
+}
+
 // Return the planar format corresponding to the given format.
-// If the format is already planar, return it.
-// Return 0 if there's no equivalent.
+// If the format is already planar or if there's no equivalent,
+// return it.
 int af_fmt_to_planar(int format)
 {
     for (int n = 0; n < MP_ARRAY_SIZE(planar_formats); n++) {
         if (planar_formats[n][1] == format)
             return planar_formats[n][0];
-        if (planar_formats[n][0] == format)
-            return format;
     }
-    return 0;
+    return format;
 }
 
 // Return the interleaved format corresponding to the given format.
-// If the format is already interleaved, return it.
-// Always succeeds if format is actually planar; otherwise return 0.
+// If the format is already interleaved or if there's no equivalent,
+// return it.
 int af_fmt_from_planar(int format)
 {
     for (int n = 0; n < MP_ARRAY_SIZE(planar_formats); n++) {
@@ -134,17 +135,6 @@
     return "??";
 }
 
-int af_fmt_seconds_to_bytes(int format, float seconds, int channels, int 
samplerate)
-{
-    assert(!af_fmt_is_planar(format));
-    int bps      = af_fmt_to_bytes(format);
-    int framelen = channels * bps;
-    int bytes    = seconds  * bps * samplerate;
-    if (bytes % framelen)
-        bytes += framelen - (bytes % framelen);
-    return bytes;
-}
-
 void af_fill_silence(void *dst, size_t bytes, int format)
 {
     memset(dst, af_fmt_is_unsigned(format) ? 0x80 : 0, bytes);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/audio/format.h 
new/mpv-0.29.1/audio/format.h
--- old/mpv-0.29.0/audio/format.h       2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/audio/format.h       2018-10-02 21:03:41.000000000 +0200
@@ -64,9 +64,6 @@
 int af_fmt_to_planar(int format);
 int af_fmt_from_planar(int format);
 
-// Amount of bytes that contain audio of the given duration, aligned to frames.
-int af_fmt_seconds_to_bytes(int format, float seconds, int channels, int 
samplerate);
-
 void af_fill_silence(void *dst, size_t bytes, int format);
 
 void af_get_best_sample_formats(int src_format, int *out_formats);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/audio/out/ao_alsa.c 
new/mpv-0.29.1/audio/out/ao_alsa.c
--- old/mpv-0.29.0/audio/out/ao_alsa.c  2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/audio/out/ao_alsa.c  2018-10-02 21:03:41.000000000 +0200
@@ -940,12 +940,24 @@
 {
     struct priv *p = ao->priv;
 
+    // in case of pausing or the device still being configured,
+    // just return our buffer size.
+    if (p->paused || snd_pcm_state(p->alsa) == SND_PCM_STATE_SETUP)
+        return p->buffersize;
+
     snd_pcm_sframes_t space = snd_pcm_avail(p->alsa);
     if (space < 0) {
-        MP_ERR(ao, "Error received from snd_pcm_avail (%ld, %s)!\n",
-               space, snd_strerror(space));
-        if (space == -EPIPE) // EOF
+        if (space == -EPIPE) {
+            MP_WARN(ao, "ALSA XRUN hit, attempting to recover...\n");
+            int err = snd_pcm_prepare(p->alsa);
+            CHECK_ALSA_ERROR("Unable to recover from under/overrun!");
             return p->buffersize;
+        }
+
+        MP_ERR(ao, "Error received from snd_pcm_avail "
+                   "(%ld, %s with ALSA state %s)!\n",
+               space, snd_strerror(space),
+               snd_pcm_state_name(snd_pcm_state(p->alsa)));
 
         // request a reload of the AO if device is not present,
         // then error out.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/audio/out/ao_jack.c 
new/mpv-0.29.1/audio/out/ao_jack.c
--- old/mpv-0.29.0/audio/out/ao_jack.c  2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/audio/out/ao_jack.c  2018-10-02 21:03:41.000000000 +0200
@@ -143,7 +143,8 @@
     if (!port_name)
         port_flags |= JackPortIsPhysical;
 
-    matching_ports = jack_get_ports(p->client, port_name, NULL, port_flags);
+    const char *port_type = JACK_DEFAULT_AUDIO_TYPE; // exclude MIDI ports
+    matching_ports = jack_get_ports(p->client, port_name, port_type, 
port_flags);
 
     if (!matching_ports || !matching_ports[0]) {
         MP_FATAL(ao, "no ports to connect to\n");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/audio/out/ao_openal.c 
new/mpv-0.29.1/audio/out/ao_openal.c
--- old/mpv-0.29.0/audio/out/ao_openal.c        2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/audio/out/ao_openal.c        2018-10-02 21:03:41.000000000 
+0200
@@ -24,19 +24,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <inttypes.h>
-
-#ifdef __APPLE__
-#ifndef AL_FORMAT_MONO_FLOAT32
-#define AL_FORMAT_MONO_FLOAT32 0x10010
-#endif
-#ifndef AL_FORMAT_STEREO_FLOAT32
-#define AL_FORMAT_STEREO_FLOAT32 0x10011
-#endif
-#ifndef AL_FORMAT_MONO_DOUBLE_EXT
-#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012
-#endif
-#include <OpenAL/MacOSX_OALExtensions.h>
-#else
 #ifdef OPENAL_AL_H
 #include <OpenAL/alc.h>
 #include <OpenAL/al.h>
@@ -46,7 +33,6 @@
 #include <AL/al.h>
 #include <AL/alext.h>
 #endif
-#endif // __APPLE__
 
 #include "common/msg.h"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/audio/out/ao_pulse.c 
new/mpv-0.29.1/audio/out/ao_pulse.c
--- old/mpv-0.29.0/audio/out/ao_pulse.c 2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/audio/out/ao_pulse.c 2018-10-02 21:03:41.000000000 +0200
@@ -454,11 +454,11 @@
     pa_stream_set_write_callback(priv->stream, stream_request_cb, ao);
     pa_stream_set_latency_update_callback(priv->stream,
                                           stream_latency_update_cb, ao);
-    int buf_size = af_fmt_seconds_to_bytes(ao->format, priv->cfg_buffer / 
1000.0,
-                                           ao->channels.num, ao->samplerate);
+    uint32_t buf_size = ao->samplerate * (priv->cfg_buffer / 1000.0) *
+        af_fmt_to_bytes(ao->format) * ao->channels.num;
     pa_buffer_attr bufattr = {
         .maxlength = -1,
-        .tlength = buf_size > 0 ? buf_size : (uint32_t)-1,
+        .tlength = buf_size > 0 ? buf_size : -1,
         .prebuf = -1,
         .minreq = -1,
         .fragsize = -1,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/ci/build-mingw64.sh 
new/mpv-0.29.1/ci/build-mingw64.sh
--- old/mpv-0.29.0/ci/build-mingw64.sh  2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/ci/build-mingw64.sh  2018-10-02 21:03:41.000000000 +0200
@@ -16,8 +16,7 @@
 export CFLAGS="-O2 -mtune=intel -g -ggdb -pipe -Wall --param=ssp-buffer-size=4 
-mms-bitfields -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fexceptions 
-fasynchronous-unwind-tables -fstack-protector-strong -fno-ident"
 export LDFLAGS="-Wl,--no-keep-memory -fstack-protector-strong"
 
-./bootstrap.py
-./waf configure \
+python3 ./waf configure \
     --enable-static-build \
     --enable-libmpv-shared \
     --enable-lua \
@@ -32,4 +31,4 @@
     --enable-shaderc \
     --enable-rubberband \
     --enable-lcms2
-./waf build --verbose
+python3 ./waf build --verbose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/ci/build-tumbleweed.sh 
new/mpv-0.29.1/ci/build-tumbleweed.sh
--- old/mpv-0.29.0/ci/build-tumbleweed.sh       2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/ci/build-tumbleweed.sh       2018-10-02 21:03:41.000000000 
+0200
@@ -1,8 +1,7 @@
 #!/bin/sh
 set -e
 
-./bootstrap.py
-./waf configure \
+python3 ./waf configure \
   --enable-cdda          \
   --enable-dvbin         \
   --enable-dvdnav        \
@@ -14,4 +13,4 @@
   --enable-shaderc       \
   --enable-vulkan        \
   --enable-zsh-comp
-./waf build --verbose
+python3 ./waf build --verbose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/common/encode_lavc.c 
new/mpv-0.29.1/common/encode_lavc.c
--- old/mpv-0.29.0/common/encode_lavc.c 2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/common/encode_lavc.c 2018-10-02 21:03:41.000000000 +0200
@@ -436,7 +436,7 @@
     return dst;
 }
 
-// Write a packet. Callee will create new pkt refs as needed.
+// Write a packet. This will take over ownership of `pkt`
 static void encode_lavc_add_packet(struct mux_stream *dst, AVPacket *pkt)
 {
     struct encode_lavc_context *ctx = dst->ctx;
@@ -476,6 +476,7 @@
     if (av_interleaved_write_frame(p->muxer, pkt) < 0) {
         MP_ERR(p, "Writing packet failed.\n");
         p->failed = true;
+        pkt = NULL;
         goto done;
     }
 
@@ -483,7 +484,8 @@
 
 done:
     pthread_mutex_unlock(&ctx->lock);
-    av_packet_free(&pkt);
+    if (pkt)
+        av_packet_unref(pkt);
 }
 
 void encode_lavc_discontinuity(struct encode_lavc_context *ctx)
@@ -949,7 +951,6 @@
             break;
 
         encode_lavc_add_packet(p->mux_stream, &packet);
-        av_packet_unref(&packet);
     }
 
     return true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/demux/demux_lavf.c 
new/mpv-0.29.1/demux/demux_lavf.c
--- old/mpv-0.29.0/demux/demux_lavf.c   2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/demux/demux_lavf.c   2018-10-02 21:03:41.000000000 +0200
@@ -162,6 +162,8 @@
     {"mp4", .skipinfo = true, .fix_editlists = true},
     {"matroska", .skipinfo = true},
 
+    {"v4l2", .no_seek = true},
+
     // In theory, such streams might contain timestamps, but virtually none do.
     {"h264", .if_flags = AVFMT_NOTIMESTAMPS },
     {"hevc", .if_flags = AVFMT_NOTIMESTAMPS },
@@ -428,6 +430,10 @@
             int nsize = av_clip(avpd.buf_size * 2, INITIAL_PROBE_SIZE,
                                 PROBE_BUF_SIZE);
             bstr buf = stream_peek(s, nsize);
+            if (demuxer->params && demuxer->params->init_fragment.len) {
+                buf = demuxer->params->init_fragment;
+                buf.len = MPMIN(buf.len, nsize);
+            }
             if (buf.len <= avpd.buf_size)
                 final_probe = true;
             memcpy(avpd.buf, buf.start, buf.len);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/demux/packet.c 
new/mpv-0.29.1/demux/packet.c
--- old/mpv-0.29.0/demux/packet.c       2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/demux/packet.c       2018-10-02 21:03:41.000000000 +0200
@@ -110,8 +110,8 @@
 void demux_packet_shorten(struct demux_packet *dp, size_t len)
 {
     assert(len <= dp->len);
-    dp->len = len;
-    memset(dp->buffer + dp->len, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+    av_shrink_packet(dp->avpacket, len);
+    dp->len = dp->avpacket->size;
 }
 
 void free_demux_packet(struct demux_packet *dp)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/osdep/macOS_mpv_helper.swift 
new/mpv-0.29.1/osdep/macOS_mpv_helper.swift
--- old/mpv-0.29.0/osdep/macOS_mpv_helper.swift 2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/osdep/macOS_mpv_helper.swift 2018-10-02 21:03:41.000000000 
+0200
@@ -45,6 +45,12 @@
         mpctx = UnsafeMutablePointer<MPContext>(mp_client_get_core(mpvHandle))
         inputContext = mpctx!.pointee.input
 
+        if let app = NSApp as? Application {
+            let ptr = mp_get_config_group(mpctx!, 
mp_client_get_global(mpvHandle),
+                                          app.getMacOSConf())
+            macOpts = 
UnsafeMutablePointer<macos_opts>(OpaquePointer(ptr))!.pointee
+        }
+
         mpv_observe_property(mpvHandle, 0, "ontop", MPV_FORMAT_FLAG)
         mpv_observe_property(mpvHandle, 0, "border", MPV_FORMAT_FLAG)
         mpv_observe_property(mpvHandle, 0, "keepaspect-window", 
MPV_FORMAT_FLAG)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/osdep/macosx_application.h 
new/mpv-0.29.1/osdep/macosx_application.h
--- old/mpv-0.29.0/osdep/macosx_application.h   2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/osdep/macosx_application.h   2018-10-02 21:03:41.000000000 
+0200
@@ -23,6 +23,7 @@
 struct macos_opts {
     int macos_title_bar_style;
     int macos_fs_animation_duration;
+    int cocoa_cb_sw_renderer;
 };
 
 // multithreaded wrapper for mpv_main
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/osdep/macosx_application.m 
new/mpv-0.29.1/osdep/macosx_application.m
--- old/mpv-0.29.0/osdep/macosx_application.m   2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/osdep/macosx_application.m   2018-10-02 21:03:41.000000000 
+0200
@@ -49,11 +49,14 @@
         OPT_CHOICE_OR_INT("macos-fs-animation-duration",
                           macos_fs_animation_duration, 0, 0, 1000,
                           ({"default", -1})),
+        OPT_CHOICE("cocoa-cb-sw-renderer", cocoa_cb_sw_renderer, 0,
+                   ({"auto", -1}, {"no", 0}, {"yes", 1})),
         {0}
     },
     .size = sizeof(struct macos_opts),
     .defaults = &(const struct macos_opts){
         .macos_fs_animation_duration = -1,
+        .cocoa_cb_sw_renderer = -1,
     },
 };
 
@@ -124,8 +127,9 @@
 
 - (NSImage *)getMPVIcon
 {
+    // The C string contains a trailing null, so we strip it away
     NSData *icon_data = [NSData dataWithBytesNoCopy:(void *)macosx_icon
-                                             length:sizeof(macosx_icon)
+                                             length:sizeof(macosx_icon) - 1
                                        freeWhenDone:NO];
     return [[NSImage alloc] initWithData:icon_data];
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/osdep/macosx_events.m 
new/mpv-0.29.1/osdep/macosx_events.m
--- old/mpv-0.29.0/osdep/macosx_events.m        2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/osdep/macosx_events.m        2018-10-02 21:03:41.000000000 
+0200
@@ -375,7 +375,8 @@
 
 - (void)restartMediaKeys
 {
-    CGEventTapEnable(self->_mk_tap_port, true);
+    if (self->_mk_tap_port)
+        CGEventTapEnable(self->_mk_tap_port, true);
 }
 
 - (void)setHighestPriotityMediaKeysTap
@@ -410,10 +411,10 @@
             tap_event_callback,
             self);
 
-        assert(self->_mk_tap_port != nil);
-
-        NSMachPort *port = (NSMachPort *)self->_mk_tap_port;
-        [[NSRunLoop mainRunLoop] addPort:port forMode:NSRunLoopCommonModes];
+        if (self->_mk_tap_port) {
+            NSMachPort *port = (NSMachPort *)self->_mk_tap_port;
+            [[NSRunLoop mainRunLoop] addPort:port 
forMode:NSRunLoopCommonModes];
+        }
     });
 }
 
@@ -421,10 +422,12 @@
 {
     dispatch_async(dispatch_get_main_queue(), ^{
         NSMachPort *port = (NSMachPort *)self->_mk_tap_port;
-        CGEventTapEnable(self->_mk_tap_port, false);
-        [[NSRunLoop mainRunLoop] removePort:port forMode:NSRunLoopCommonModes];
-        CFRelease(self->_mk_tap_port);
-        self->_mk_tap_port = nil;
+        if (port) {
+            CGEventTapEnable(self->_mk_tap_port, false);
+            [[NSRunLoop mainRunLoop] removePort:port 
forMode:NSRunLoopCommonModes];
+            CFRelease(self->_mk_tap_port);
+            self->_mk_tap_port = nil;
+        }
     });
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/osdep/macosx_menubar.m 
new/mpv-0.29.1/osdep/macosx_menubar.m
--- old/mpv-0.29.0/osdep/macosx_menubar.m       2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/osdep/macosx_menubar.m       2018-10-02 21:03:41.000000000 
+0200
@@ -602,7 +602,7 @@
 - (NSMenu *)mainMenu
 {
     NSMenu *mainMenu = [[NSMenu alloc] initWithTitle:@"MainMenu"];
-    NSApp.servicesMenu = [NSMenu alloc];
+    [NSApp setServicesMenu:[[NSMenu alloc] init]];
 
     for(id mMenu in menuTree) {
         NSMenu *menu = [[NSMenu alloc] initWithTitle:mMenu[@"name"]];
@@ -633,7 +633,7 @@
                 }
 
                 if ([subMenu[@"name"] isEqual:@"Services"]) {
-                    iItem.submenu = NSApp.servicesMenu;
+                    iItem.submenu = [NSApp servicesMenu];
                 }
             }
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/player/loadfile.c 
new/mpv-0.29.1/player/loadfile.c
--- old/mpv-0.29.0/player/loadfile.c    2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/player/loadfile.c    2018-10-02 21:03:41.000000000 +0200
@@ -1296,21 +1296,21 @@
 
     update_demuxer_properties(mpctx);
 
+    update_playback_speed(mpctx);
+
+    reinit_video_chain(mpctx);
+    reinit_audio_chain(mpctx);
+    reinit_sub_all(mpctx);
+
     if (mpctx->encode_lavc_ctx) {
-        if (mpctx->current_track[0][STREAM_VIDEO])
+        if (mpctx->vo_chain)
             encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_VIDEO);
-        if (mpctx->current_track[0][STREAM_AUDIO])
+        if (mpctx->ao_chain)
             encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_AUDIO);
         encode_lavc_set_metadata(mpctx->encode_lavc_ctx,
                                  mpctx->demuxer->metadata);
     }
 
-    update_playback_speed(mpctx);
-
-    reinit_video_chain(mpctx);
-    reinit_audio_chain(mpctx);
-    reinit_sub_all(mpctx);
-
     if (!mpctx->vo_chain && !mpctx->ao_chain && opts->stream_auto_sel) {
         MP_FATAL(mpctx, "No video or audio streams selected.\n");
         mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/player/lua/ytdl_hook.lua 
new/mpv-0.29.1/player/lua/ytdl_hook.lua
--- old/mpv-0.29.0/player/lua/ytdl_hook.lua     2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/player/lua/ytdl_hook.lua     2018-10-02 21:03:41.000000000 
+0200
@@ -314,8 +314,8 @@
             if track.vcodec and track.vcodec ~= "none" then
                 -- video track
                 streamurl = edl_track or track.url
-            elseif track.acodec and track.acodec ~= "none" and track.vcodec == 
"none" then
-                -- audio track
+            elseif track.vcodec == "none" then
+                -- according to ytdl, if vcodec is None, it's audio
                 mp.commandv("audio-add",
                     edl_track or track.url, "auto",
                     track.format_note or "")
@@ -429,12 +429,7 @@
     mp.set_property_native("file-local-options/stream-lavf-o", stream_opts)
 end
 
-mp.add_hook(o.try_ytdl_first and "on_load" or "on_load_fail", 10, function ()
-    local url = mp.get_property("stream-open-filename", "")
-    if not (url:find("ytdl://") == 1) and
-        not ((url:find("https?://") == 1) and not is_blacklisted(url)) then
-        return
-    end
+function run_ytdl_hook(url)
     local start_time = os.clock()
 
     -- check for youtube-dl in mpv's config dir
@@ -655,8 +650,29 @@
         add_single_video(json)
     end
     msg.debug('script running time: '..os.clock()-start_time..' seconds')
-end)
+end
 
+if (not o.try_ytdl_first) then
+    mp.add_hook("on_load", 10, function ()
+        msg.verbose('ytdl:// hook')
+        local url = mp.get_property("stream-open-filename", "")
+        if not (url:find("ytdl://") == 1) then
+            msg.verbose('not a ytdl:// url')
+            return
+        end
+        run_ytdl_hook(url)
+    end)
+end
+
+mp.add_hook(o.try_ytdl_first and "on_load" or "on_load_fail", 10, function()
+    msg.verbose('full hook')
+    local url = mp.get_property("stream-open-filename", "")
+    if not (url:find("ytdl://") == 1) and
+        not ((url:find("https?://") == 1) and not is_blacklisted(url)) then
+        return
+    end
+    run_ytdl_hook(url)
+end)
 
 mp.add_hook("on_preloaded", 10, function ()
     if next(chapter_list) ~= nil then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/stream/stream_file.c 
new/mpv-0.29.1/stream/stream_file.c
--- old/mpv-0.29.0/stream/stream_file.c 2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/stream/stream_file.c 2018-10-02 21:03:41.000000000 +0200
@@ -121,16 +121,16 @@
 static int write_buffer(stream_t *s, char *buffer, int len)
 {
     struct priv *p = s->priv;
-    int r;
-    int wr = 0;
-    while (wr < len) {
-        r = write(p->fd, buffer, len);
-        if (r <= 0)
+    int r = len;
+    int wr;
+    while (r > 0) {
+        wr = write(p->fd, buffer, r);
+        if (wr <= 0)
             return -1;
-        wr += r;
-        buffer += r;
+        r -= wr;
+        buffer += wr;
     }
-    return len;
+    return len - r;
 }
 
 static int seek(stream_t *s, int64_t newpos)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/stream/stream_libarchive.c 
new/mpv-0.29.1/stream/stream_libarchive.c
--- old/mpv-0.29.0/stream/stream_libarchive.c   2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/stream/stream_libarchive.c   2018-10-02 21:03:41.000000000 
+0200
@@ -432,8 +432,15 @@
             int size = MPMIN(newpos - s->pos, sizeof(buffer));
             locale_t oldlocale = uselocale(p->mpa->locale);
             int r = archive_read_data(p->mpa->arch, buffer, size);
-            if (r < 0) {
-                MP_ERR(s, "%s\n", archive_error_string(p->mpa->arch));
+            if (r <= 0) {
+                if (r == 0 && newpos > p->entry_size) {
+                    MP_ERR(s, "demuxer trying to seek beyond end of archive "
+                           "entry\n");
+                } else if (r == 0) {
+                    MP_ERR(s, "end of archive entry reached while seeking\n");
+                } else {
+                    MP_ERR(s, "%s\n", archive_error_string(p->mpa->arch));
+                }
                 uselocale(oldlocale);
                 if (mp_archive_check_fatal(p->mpa, r)) {
                     mp_archive_free(p->mpa);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/stream/stream_smb.c 
new/mpv-0.29.1/stream/stream_smb.c
--- old/mpv-0.29.0/stream/stream_smb.c  2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/stream/stream_smb.c  2018-10-02 21:03:41.000000000 +0200
@@ -21,6 +21,7 @@
 
 #include <libsmbclient.h>
 #include <unistd.h>
+#include <pthread.h>
 
 #include "common/msg.h"
 #include "stream.h"
@@ -31,6 +32,8 @@
 #error GPL only
 #endif
 
+static pthread_mutex_t smb_lock = PTHREAD_MUTEX_INITIALIZER;
+
 struct priv {
     int fd;
 };
@@ -46,8 +49,10 @@
   struct priv *p = s->priv;
   switch(cmd) {
     case STREAM_CTRL_GET_SIZE: {
+      pthread_mutex_lock(&smb_lock);
       off_t size = smbc_lseek(p->fd,0,SEEK_END);
       smbc_lseek(p->fd,s->pos,SEEK_SET);
+      pthread_mutex_unlock(&smb_lock);
       if(size != (off_t)-1) {
         *(int64_t *)arg = size;
         return 1;
@@ -60,7 +65,10 @@
 
 static int seek(stream_t *s,int64_t newpos) {
   struct priv *p = s->priv;
-  if(smbc_lseek(p->fd,newpos,SEEK_SET)<0) {
+  pthread_mutex_lock(&smb_lock);
+  off_t size = smbc_lseek(p->fd,newpos,SEEK_SET);
+  pthread_mutex_unlock(&smb_lock);
+  if(size<0) {
     return 0;
   }
   return 1;
@@ -68,27 +76,33 @@
 
 static int fill_buffer(stream_t *s, char* buffer, int max_len){
   struct priv *p = s->priv;
+  pthread_mutex_lock(&smb_lock);
   int r = smbc_read(p->fd,buffer,max_len);
+  pthread_mutex_unlock(&smb_lock);
   return (r <= 0) ? -1 : r;
 }
 
 static int write_buffer(stream_t *s, char* buffer, int len) {
   struct priv *p = s->priv;
-  int r;
-  int wr = 0;
-  while (wr < len) {
-    r = smbc_write(p->fd,buffer,len);
-    if (r <= 0)
+  int r = len;
+  int wr;
+  while (r > 0) {
+    pthread_mutex_lock(&smb_lock);
+    wr = smbc_write(p->fd,buffer,r);
+    pthread_mutex_unlock(&smb_lock);
+    if (wr <= 0)
       return -1;
-    wr += r;
-    buffer += r;
+    r -= wr;
+    buffer += wr;
   }
-  return len;
+  return len - r;
 }
 
 static void close_f(stream_t *s){
   struct priv *p = s->priv;
+  pthread_mutex_lock(&smb_lock);
   smbc_close(p->fd);
+  pthread_mutex_unlock(&smb_lock);
 }
 
 static int open_f (stream_t *stream)
@@ -110,13 +124,17 @@
     return STREAM_ERROR;
   }
 
+  pthread_mutex_lock(&smb_lock);
   err = smbc_init(smb_auth_fn, 1);
+  pthread_mutex_unlock(&smb_lock);
   if (err < 0) {
     MP_ERR(stream, "Cannot init the libsmbclient library: %d\n",err);
     return STREAM_ERROR;
   }
 
+  pthread_mutex_lock(&smb_lock);
   fd = smbc_open(filename, m,0644);
+  pthread_mutex_unlock(&smb_lock);
   if (fd < 0) {
     MP_ERR(stream, "Could not open from LAN: '%s'\n", filename);
     return STREAM_ERROR;
@@ -124,8 +142,10 @@
 
   len = 0;
   if(!write) {
+    pthread_mutex_lock(&smb_lock);
     len = smbc_lseek(fd,0,SEEK_END);
     smbc_lseek (fd, 0, SEEK_SET);
+    pthread_mutex_unlock(&smb_lock);
   }
   if(len > 0 || write) {
     stream->seekable = true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/mp_image.c 
new/mpv-0.29.1/video/mp_image.c
--- old/mpv-0.29.0/video/mp_image.c     2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/video/mp_image.c     2018-10-02 21:03:41.000000000 +0200
@@ -812,6 +812,12 @@
         }
     }
 
+    if (!mp_trc_is_hdr(params->color.gamma)) {
+        // Some clips have leftover HDR metadata after conversion to SDR, so to
+        // avoid blowing up the tone mapping code, strip/sanitize it
+        params->color.sig_peak = 1.0;
+    }
+
     if (params->chroma_location == MP_CHROMA_AUTO) {
         if (params->color.levels == MP_CSP_LEVELS_TV)
             params->chroma_location = MP_CHROMA_LEFT;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/cocoa-cb/events_view.swift 
new/mpv-0.29.1/video/out/cocoa-cb/events_view.swift
--- old/mpv-0.29.0/video/out/cocoa-cb/events_view.swift 2018-07-22 
18:46:25.000000000 +0200
+++ new/mpv-0.29.1/video/out/cocoa-cb/events_view.swift 2018-10-02 
21:03:41.000000000 +0200
@@ -233,7 +233,7 @@
             topMargin = cocoaCB.window.titleBarHeight + 1 + menuBarHeight
         }
 
-        var vF = window!.screen!.frame
+        guard var vF = window?.screen?.frame else { return false }
         vF.size.height -= topMargin
 
         let vFW = window!.convertFromScreen(vF)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/cocoa-cb/video_layer.swift 
new/mpv-0.29.1/video/out/cocoa-cb/video_layer.swift
--- old/mpv-0.29.0/video/out/cocoa-cb/video_layer.swift 2018-07-22 
18:46:25.000000000 +0200
+++ new/mpv-0.29.1/video/out/cocoa-cb/video_layer.swift 2018-10-02 
21:03:41.000000000 +0200
@@ -32,6 +32,7 @@
     var needsFlip: Bool = false
     var canDrawOffScreen: Bool = false
     var cglContext: CGLContextObj? = nil
+    var cglPixelFormat: CGLPixelFormatObj? = nil
     var surfaceSize: NSSize?
 
     enum Draw: Int { case normal = 1, atomic, atomicEnd }
@@ -62,7 +63,8 @@
         autoresizingMask = [.layerWidthSizable, .layerHeightSizable]
         backgroundColor = NSColor.black.cgColor
 
-        CGLCreateContext(copyCGLPixelFormat(forDisplayMask: 0), nil, 
&cglContext)
+        cglPixelFormat = copyCGLPixelFormat(forDisplayMask: 0)
+        CGLCreateContext(cglPixelFormat!, nil, &cglContext)
         var i: GLint = 1
         CGLSetParameter(cglContext!, kCGLCPSwapInterval, &i)
         CGLSetCurrentContext(cglContext!)
@@ -147,6 +149,8 @@
     }
 
     override func copyCGLPixelFormat(forDisplayMask mask: UInt32) -> 
CGLPixelFormatObj {
+        if cglPixelFormat != nil { return cglPixelFormat! }
+
         let glVersions: [CGLOpenGLProfile] = [
             kCGLOGLPVersion_3_2_Core,
             kCGLOGLPVersion_Legacy
@@ -157,6 +161,8 @@
         var npix: GLint = 0
 
         verLoop : for ver in glVersions {
+            if mpv.macOpts!.cocoa_cb_sw_renderer == 1 { break }
+
             var glAttributes: [CGLPixelFormatAttribute] = [
                 kCGLPFAOpenGLProfile, CGLPixelFormatAttribute(ver.rawValue),
                 kCGLPFAAccelerated,
@@ -177,9 +183,28 @@
             }
         }
 
+        if (err != kCGLNoError || pix == nil) && 
mpv.macOpts!.cocoa_cb_sw_renderer != 0 {
+            if mpv.macOpts!.cocoa_cb_sw_renderer == -1 {
+                let errS = String(cString: CGLErrorString(err))
+                mpv.sendWarning("Couldn't create hardware accelerated CGL " +
+                                "pixel format, falling back to software " +
+                                "renderer: \(errS) (\(err.rawValue))")
+            }
+
+            let glAttributes: [CGLPixelFormatAttribute] = [
+                kCGLPFAOpenGLProfile, 
CGLPixelFormatAttribute(kCGLOGLPVersion_3_2_Core.rawValue),
+                kCGLPFARendererID, 
CGLPixelFormatAttribute(UInt32(kCGLRendererGenericFloatID)),
+                kCGLPFADoubleBuffer,
+                kCGLPFABackingStore,
+                _CGLPixelFormatAttribute(rawValue: 0)
+            ]
+
+            err = CGLChoosePixelFormat(glAttributes, &pix, &npix)
+        }
+
         if err != kCGLNoError || pix == nil {
             let errS = String(cString: CGLErrorString(err))
-            mpv.sendError("Couldn't create CGL pixel format: \(errS) 
(\(err.rawValue))")
+            mpv.sendError("Couldn't create any CGL pixel format: \(errS) 
(\(err.rawValue))")
             exit(1)
         }
         return pix!
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/cocoa-cb/window.swift 
new/mpv-0.29.1/video/out/cocoa-cb/window.swift
--- old/mpv-0.29.0/video/out/cocoa-cb/window.swift      2018-07-22 
18:46:25.000000000 +0200
+++ new/mpv-0.29.1/video/out/cocoa-cb/window.swift      2018-10-02 
21:03:41.000000000 +0200
@@ -309,7 +309,7 @@
     }
 
     func endAnimation(_ newFrame: NSRect = NSZeroRect) {
-        if !NSEqualRects(newFrame, NSZeroRect) {
+        if !NSEqualRects(newFrame, NSZeroRect) && isAnimating {
             NSAnimationContext.runAnimationGroup({ (context) -> Void in
                 context.duration = 0.01
                 self.animator().setFrame(newFrame, display: true)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/cocoa_cb_common.swift 
new/mpv-0.29.1/video/out/cocoa_cb_common.swift
--- old/mpv-0.29.0/video/out/cocoa_cb_common.swift      2018-07-22 
18:46:25.000000000 +0200
+++ new/mpv-0.29.1/video/out/cocoa_cb_common.swift      2018-10-02 
21:03:41.000000000 +0200
@@ -61,12 +61,6 @@
         if backendState == .uninitialized {
             backendState = .needsInit
 
-            if let app = NSApp as? Application {
-                let ptr = mp_get_config_group(mpv.mpctx!, vo.pointee.global,
-                                              app.getMacOSConf())
-                mpv.macOpts = 
UnsafeMutablePointer<macos_opts>(OpaquePointer(ptr))!.pointee
-            }
-
             view = EventsView(cocoaCB: self)
             view.layer = layer
             view.wantsLayer = true
@@ -241,7 +235,9 @@
 
     func updateICCProfile() {
         mpv.setRenderICCProfile(window.screen!.colorSpace!)
-        layer.colorspace = window.screen!.colorSpace!.cgColorSpace!
+        if #available(macOS 10.11, *) {
+            layer.colorspace = window.screen!.colorSpace!.cgColorSpace!
+        }
     }
 
     func lmuToLux(_ v: UInt64) -> Int {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/cocoa_common.m 
new/mpv-0.29.1/video/out/cocoa_common.m
--- old/mpv-0.29.0/video/out/cocoa_common.m     2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/video/out/cocoa_common.m     2018-10-02 21:03:41.000000000 
+0200
@@ -172,8 +172,10 @@
     NSBundle *bundle = [NSBundle mainBundle];
     if ([bundle pathForResource:@"icon" ofType:@"icns"])
         return;
+
+    // The C string contains a trailing null, so we strip it away
     NSData *icon_data = [NSData dataWithBytesNoCopy:(void *)macosx_icon
-                                             length:sizeof(macosx_icon)
+                                             length:sizeof(macosx_icon) - 1
                                        freeWhenDone:NO];
     NSImage *icon = [[NSImage alloc] initWithData:icon_data];
     [app setApplicationIconImage:icon];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/drm_atomic.c 
new/mpv-0.29.1/video/out/drm_atomic.c
--- old/mpv-0.29.0/video/out/drm_atomic.c       2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/video/out/drm_atomic.c       2018-10-02 21:03:41.000000000 
+0200
@@ -263,21 +263,16 @@
             mp_verbose(log, "Using default plane %d for video\n", overlay_id);
             ctx->video_plane = drm_object_create(log, ctx->fd, overlay_id, 
DRM_MODE_OBJECT_PLANE);
         } else {
-            mp_err(log, "Failed to find video plane with id=%d\n", 
video_plane_id);
-            goto fail;
+            mp_verbose(log, "Failed to find video plane with id=%d. 
drmprime-drm hwdec interop will not work\n", video_plane_id);
         }
     } else {
         mp_verbose(log, "Found video plane with ID %d\n", 
ctx->video_plane->id);
     }
 
-    mp_verbose(log, "Found Video plane with ID %d, OSD with ID %d\n",
-               ctx->video_plane->id, ctx->osd_plane->id);
-
     drmModeFreePlaneResources(plane_res);
     drmModeFreeResources(res);
     return ctx;
 
-
 fail:
     if (res)
         drmModeFreeResources(res);
@@ -301,6 +296,9 @@
 static bool drm_atomic_save_plane_state(struct drm_object *plane,
                                         struct drm_atomic_plane_state 
*plane_state)
 {
+    if (!plane)
+        return true;
+
     bool ret = true;
 
     if (0 > drm_object_get_property(plane, "FB_ID", &plane_state->fb_id))
@@ -333,6 +331,9 @@
                                            struct drm_object *plane,
                                            const struct drm_atomic_plane_state 
*plane_state)
 {
+    if (!plane)
+        return true;
+
     bool ret = true;
 
     if (0 > drm_object_set_property(request, plane, "FB_ID", 
plane_state->fb_id))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/gpu/video.c 
new/mpv-0.29.1/video/out/gpu/video.c
--- old/mpv-0.29.0/video/out/gpu/video.c        2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/video/out/gpu/video.c        2018-10-02 21:03:41.000000000 
+0200
@@ -1103,8 +1103,14 @@
 
 // Sets the appropriate compute shader metadata for an implicit compute pass
 // bw/bh: block size
-static void pass_is_compute(struct gl_video *p, int bw, int bh)
+static void pass_is_compute(struct gl_video *p, int bw, int bh, bool flexible)
 {
+    if (p->pass_compute.active && flexible) {
+        // Avoid overwriting existing block sizes when using a flexible pass
+        bw = p->pass_compute.block_w;
+        bh = p->pass_compute.block_h;
+    }
+
     p->pass_compute = (struct compute_info){
         .active = true,
         .block_w = bw,
@@ -1248,7 +1254,7 @@
     // If RA_CAP_PARALLEL_COMPUTE is set, try to prefer compute shaders
     // over fragment shaders wherever possible.
     if (!p->pass_compute.active && (p->ra->caps & RA_CAP_PARALLEL_COMPUTE))
-        pass_is_compute(p, 16, 16);
+        pass_is_compute(p, 16, 16, true);
 
     if (p->pass_compute.active) {
         gl_sc_uniform_image2D_wo(p->sc, "out_image", *dst_tex);
@@ -1744,7 +1750,7 @@
     if (shmem_req > p->ra->max_shmem)
         goto fallback;
 
-    pass_is_compute(p, bw, bh);
+    pass_is_compute(p, bw, bh, false);
     pass_compute_polar(p->sc, scaler, img.components, bw, bh, iw, ih);
     return;
 
@@ -2485,7 +2491,7 @@
 
     if (detect_peak) {
         pass_describe(p, "detect HDR peak");
-        pass_is_compute(p, 8, 8); // 8x8 is good for performance
+        pass_is_compute(p, 8, 8, true); // 8x8 is good for performance
         gl_sc_ssbo(p->sc, "PeakDetect", p->hdr_peak_ssbo,
             "uint counter;"
             "uint frame_idx;"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/opengl/common.c 
new/mpv-0.29.1/video/out/opengl/common.c
--- old/mpv-0.29.0/video/out/opengl/common.c    2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/video/out/opengl/common.c    2018-10-02 21:03:41.000000000 
+0200
@@ -42,7 +42,8 @@
            strcmp(renderer, "Software Rasterizer") == 0 ||
            strstr(renderer, "llvmpipe") ||
            strcmp(vendor, "Microsoft Corporation") == 0 ||
-           strcmp(renderer, "Mesa X11") == 0;
+           strcmp(renderer, "Mesa X11") == 0 ||
+           strcmp(renderer, "Apple Software Renderer") == 0;
 }
 
 static void GLAPIENTRY dummy_glBindFramebuffer(GLenum target, GLuint 
framebuffer)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/video/out/opengl/hwdec_drmprime_drm.c 
new/mpv-0.29.1/video/out/opengl/hwdec_drmprime_drm.c
--- old/mpv-0.29.0/video/out/opengl/hwdec_drmprime_drm.c        2018-07-22 
18:46:25.000000000 +0200
+++ new/mpv-0.29.1/video/out/opengl/hwdec_drmprime_drm.c        2018-10-02 
21:03:41.000000000 +0200
@@ -257,6 +257,10 @@
             mp_err(p->log, "Failed to retrieve DRM atomic context.\n");
             goto err;
         }
+        if (!p->ctx->video_plane) {
+            mp_warn(p->log, "No video plane. You might need to specify it 
manually using --drm-video-plane-id\n");
+            goto err;
+        }
     } else {
         mp_verbose(p->log, "Failed to retrieve DRM fd from native display.\n");
         goto err;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/waftools/checks/custom.py 
new/mpv-0.29.1/waftools/checks/custom.py
--- old/mpv-0.29.0/waftools/checks/custom.py    2018-07-22 18:46:25.000000000 
+0200
+++ new/mpv-0.29.1/waftools/checks/custom.py    2018-10-02 21:03:41.000000000 
+0200
@@ -4,7 +4,7 @@
 import os
 
 __all__ = ["check_pthreads", "check_iconv", "check_lua",
-           "check_cocoa", "check_openal", "check_wl_protocols"]
+           "check_cocoa", "check_wl_protocols", "check_swift"]
 
 pthreads_program = load_fragment('pthreads.c')
 
@@ -112,13 +112,11 @@
 
     return res
 
-def check_openal(ctx, dependency_identifier):
-    checks = [
-        check_pkg_config('openal', '>= 1.13'),
-        check_statement(['OpenAL/AL.h'], 'int i = AL_VERSION', 
framework='OpenAL')
-        ]
-
-    for fn in checks:
-        if fn(ctx, dependency_identifier):
+def check_swift(ctx, dependency_identifier):
+    if ctx.env.SWIFT_VERSION:
+        major = int(ctx.env.SWIFT_VERSION.split('.')[0])
+        ctx.add_optional_message(dependency_identifier,
+                                 'version found: ' + ctx.env.SWIFT_VERSION)
+        if major >= 3:
             return True
     return False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/waftools/detections/compiler_swift.py 
new/mpv-0.29.1/waftools/detections/compiler_swift.py
--- old/mpv-0.29.0/waftools/detections/compiler_swift.py        2018-07-22 
18:46:25.000000000 +0200
+++ new/mpv-0.29.1/waftools/detections/compiler_swift.py        2018-10-02 
21:03:41.000000000 +0200
@@ -11,8 +11,8 @@
     ctx.env.SWIFT_FLAGS = ('-frontend -c -sdk %s -enable-objc-interop'
                            ' -emit-objc-header -parse-as-library'
                            ' -target x86_64-apple-macosx10.10') % 
(ctx.env.MACOS_SDK)
-    swift_version = __run([ctx.env.SWIFT, '-version']).split(' 
')[3].split('.')[:2]
-    major, minor = [int(n) for n in swift_version]
+    ctx.env.SWIFT_VERSION = __run([ctx.env.SWIFT, '-version']).split(' ')[3]
+    major, minor = [int(n) for n in ctx.env.SWIFT_VERSION.split('.')[:2]]
 
     # the -swift-version parameter is only supported on swift 3.1 and newer
     if major >= 3 and minor >= 1 or major >= 4:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-0.29.0/wscript new/mpv-0.29.1/wscript
--- old/mpv-0.29.0/wscript      2018-07-22 18:46:25.000000000 +0200
+++ new/mpv-0.29.1/wscript      2018-10-02 21:03:41.000000000 +0200
@@ -169,6 +169,11 @@
         'fmsg': 'Unable to find either POSIX or MinGW-w64 environment, ' \
                 'or compiler does not work.',
     }, {
+        'name': '--swift',
+        'desc': 'macOS Swift build tools',
+        'deps': 'os-darwin',
+        'func': check_swift,
+    }, {
         'name': '--uwp',
         'desc': 'Universal Windows Platform',
         'default': 'disable',
@@ -506,7 +511,7 @@
     }, {
         'name': '--openal',
         'desc': 'OpenAL audio output',
-        'func': check_openal,
+        'func': check_pkg_config('openal', '>= 1.13'),
         'default': 'disable'
     }, {
         'name': '--opensles',
@@ -912,7 +917,7 @@
      }, {
         'name': '--macos-cocoa-cb',
         'desc': 'macOS opengl-cb backend',
-        'deps': 'cocoa',
+        'deps': 'cocoa  && swift',
         'func': check_true
     }
 ]



Reply via email to