media-video/mpv: warn re softvol, non-fatal ffmpeg version check in 9999
authorIlya Tumaykin <itumaykin@gmail.com>
Sun, 17 Jul 2016 21:56:37 +0000 (00:56 +0300)
committerPatrice Clement <monsieurp@gentoo.org>
Mon, 25 Jul 2016 13:02:18 +0000 (15:02 +0200)
Package-Manager: portage-2.3.0

Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
media-video/mpv/files/mpv-0.18.1-make-ffmpeg-version-check-non-fatal.patch [new file with mode: 0644]
media-video/mpv/mpv-9999.ebuild

diff --git a/media-video/mpv/files/mpv-0.18.1-make-ffmpeg-version-check-non-fatal.patch b/media-video/mpv/files/mpv-0.18.1-make-ffmpeg-version-check-non-fatal.patch
new file mode 100644 (file)
index 0000000..fcdd4d5
--- /dev/null
@@ -0,0 +1,28 @@
+player: make ffmpeg/libav version check non-fatal
+
+We already enforce mpv rebuilds when ffmpeg/libav SONAME changes.
+
+diff --git a/player/main.c b/player/main.c
+index 88b60e1..1d12679 100644
+--- a/player/main.c
++++ b/player/main.c
+@@ -421,13 +421,12 @@ int mp_initialize(struct MPContext *mpctx, char **options)
+     if (!print_libav_versions(mp_null_log, 0)) {
+         // Using mismatched libraries can be legitimate, but even then it's
+         // a bad idea. We don't acknowledge its usefulness and stability.
+-        print_libav_versions(mpctx->log, MSGL_FATAL);
+-        MP_FATAL(mpctx, "\nmpv was compiled against a different 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\nmpv does not support this "
+-                 "configuration and will not run - rebuild mpv instead.\n");
+-        return -1;
++        print_libav_versions(mpctx->log, MSGL_WARN);
++        MP_WARN(mpctx, "\nmpv was compiled against a different 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\nUpstream does not support this "
++                "configuration.\nPlease rebuild mpv in case of any problems.\n");
+     }
+
+     if (opts->dump_stats && opts->dump_stats[0]) {
index ccb8073b91a4f88c2bb7783f31991d5d5ad8e175..fbbb674ad013a6ef3c141eddd8b4267a71b882cc 100644 (file)
@@ -9,7 +9,7 @@ PYTHON_REQ_USE='threads(+)'
 
 WAF_PV=1.8.12
 
-inherit fdo-mime gnome2-utils pax-utils python-any-r1 toolchain-funcs waf-utils
+inherit fdo-mime gnome2-utils pax-utils python-any-r1 toolchain-funcs versionator waf-utils
 
 DESCRIPTION="Media player based on MPlayer and mplayer2"
 HOMEPAGE="https://mpv.io/"
@@ -126,6 +126,8 @@ RDEPEND="${COMMON_DEPEND}
        selinux? ( sec-policy/selinux-mplayer )
 "
 
+PATCHES=( "${FILESDIR}/${PN}-0.18.1-make-ffmpeg-version-check-non-fatal.patch" )
+
 pkg_pretend() {
        if [[ ${MERGE_TYPE} != "binary" ]] && ! tc-has-tls && use vaapi && use egl; then
                die "Your compiler lacks C++11 TLS support. Use GCC>=4.8.0 or Clang>=3.3."
@@ -269,6 +271,26 @@ pkg_postinst() {
        fdo-mime_desktop_database_update
        gnome2_icon_cache_update
 
+       local softvol_0_18_1=0
+       for rv in ${REPLACING_VERSIONS}; do
+               version_compare ${rv} 0.18.1
+               [[ $? -eq 1 ]] && softvol_0_18_1=1
+       done
+
+       if [[ ${softvol_0_18_1} -eq 1 ]]; then
+               echo
+               elog "Starting from version 0.18.1 the software volume control is"
+               elog "enabled by default, see:"
+               elog "https://github.com/mpv-player/mpv/blob/v0.18.1/DOCS/interface-changes.rst"
+               elog "https://github.com/mpv-player/mpv/issues/3322"
+               elog
+               elog "This means that volume controls don't change the system volume,"
+               elog "e.g. per-application volume with PulseAudio."
+               elog "If you want to restore the old behaviour, please refer to"
+               elog "https://bugs.gentoo.org/show_bug.cgi?id=588492#c4"
+               echo
+       fi
+
        # bash-completion < 2.3-r1 already installs (mostly broken) mpv completion.
        if use cli && ! has_version '<app-shells/bash-completion-2.3-r1' && \
                ! has_version 'app-shells/mpv-bash-completion'; then