Unverified Commit aab07337 authored by Bobby Rong's avatar Bobby Rong Committed by GitHub
Browse files

Merge pull request #203563 from bobby285271/hypnotix-bpo

[22.11] hypnotix: Fix launching with mpv 0.35.0
parents 2921981f 3bc6c64e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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 = ''
+22 −0
Original line number Diff line number Diff line
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: