Skip to content

Commit

Permalink
hypnotix: Fix launching with mpv 0.35.0
Browse files Browse the repository at this point in the history
See hypnotix issue 254 for more info.
  • Loading branch information
bobby285271 committed Nov 29, 2022
1 parent 6e8d5bb commit f0c5278
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/applications/video/hypnotix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ stdenv.mkDerivation rec {
src = ./libmpv-path.patch;
libmpv = "${lib.getLib mpv}/lib/libmpv${stdenv.hostPlatform.extensions.sharedLibrary}";
})

# Fix launching with mpv 0.35.0 (ubuntu 22.04 doesn't have libmpv.so.2)
# https://github.com/linuxmint/hypnotix/issues/254
./fix-deprecated-mpv-detach-destroy.patch
];

postPatch = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/usr/lib/hypnotix/mpv.py b/usr/lib/hypnotix/mpv.py
index f42a3be..db94bf6 100644
--- a/usr/lib/hypnotix/mpv.py
+++ b/usr/lib/hypnotix/mpv.py
@@ -528,7 +528,7 @@ _mpv_create = backend.mpv_create
_handle_func('mpv_create_client', [c_char_p], MpvHandle, notnull_errcheck)
_handle_func('mpv_client_name', [], c_char_p, errcheck=None)
_handle_func('mpv_initialize', [], c_int, ec_errcheck)
-_handle_func('mpv_detach_destroy', [], None, errcheck=None)
+_handle_func('mpv_destroy', [], None, errcheck=None)
_handle_func('mpv_terminate_destroy', [], None, errcheck=None)
_handle_func('mpv_load_config_file', [c_char_p], c_int, ec_errcheck)
_handle_func('mpv_get_time_us', [], c_ulonglong, errcheck=None)
@@ -881,7 +881,7 @@ class MPV(object):
self._message_handlers[target](*args)

if eid == MpvEventID.SHUTDOWN:
- _mpv_detach_destroy(self._event_handle)
+ _mpv_destroy(self._event_handle)
return

except Exception as e:

0 comments on commit f0c5278

Please sign in to comment.