xpra icon
Bug tracker and wiki

Ticket #2801: xpra-4.0-sound-module.patch

File xpra-4.0-sound-module.patch, 2.1 KB (added by mehw, 2 months ago)

proposed patch

  • xpra/client/gl/gl_check.py

    This closes the Ticket #2801:
    http://xpra.org/trac/ticket/2801
    
    When running setup.py with the options '--with-opengl --without-sound'
    there will be an error starting the client:
    
    $ xpra start :7
    $ xpra attach :7
    
    Warning: cannot import native OpenGL module
     No module named 'xpra.sound'
    
    The changeset 25991 introduced the use of the function force_enabled
    imported from the sound module in gl_check.py. Despite the fact that
    it requires one argument, it is used without when checking OpenGL. I
    believe that force_enable is meant to be used instead, which doesn't
    require to import the sound module. Hence OpenGL can be checked with
    no sound module.
    https://xpra.org/trac/changeset/25991/xpra/trunk/src/xpra/client/gl/gl_check.py
    
    diff -Nuar a/xpra/client/gl/gl_check.py b/xpra/client/gl/gl_check.py
    a b  
    1212from xpra.os_util import POSIX, OSX, bytestostr
    1313from xpra.log import Logger, CaptureHandler
    1414from xpra.client.gl.gl_drivers import WHITELIST, GREYLIST, VERSION_REQ, BLACKLIST, OpenGLFatalError
    15 from xpra.sound.gstreamer_util import force_enabled
    1615
    1716log = Logger("opengl")
    1817
     
    130129        from OpenGL.GL import GL_VERSION, GL_EXTENSIONS
    131130        from OpenGL.GL import glGetString, glGetIntegerv
    132131        gl_version_str = glGetString(GL_VERSION)
    133         if gl_version_str is None and not force_enabled:
     132        if gl_version_str is None and not force_enable:
    134133            raise_fatal_error("OpenGL version is missing - cannot continue")
    135134            return props
    136135        #b'4.6.0 NVIDIA 440.59' -> ['4', '6', '0 NVIDIA...']
     
    147146            props["opengl"] = gl_major, gl_minor
    148147            MIN_VERSION = (1,1)
    149148            if (gl_major, gl_minor) < MIN_VERSION:
    150                 if not force_enabled:
     149                if not force_enable:
    151150                    raise_fatal_error("OpenGL output requires version %s or greater, not %s.%s" %
    152151                                  (".".join([str(x) for x in MIN_VERSION]), gl_major, gl_minor))
    153152                    return props