forked from openlp/openlp
Run XInitThreads when using VLC to make it work correctly. Fixes bug 1433245.
Fixes: https://launchpad.net/bugs/1433245
This commit is contained in:
parent
c3d21ca742
commit
27332f87e1
|
@ -30,7 +30,7 @@ import threading
|
||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.common import Settings, is_win, is_macosx
|
from openlp.core.common import Settings, is_win, is_macosx, is_linux
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
from openlp.core.ui.media import MediaState, MediaType
|
from openlp.core.ui.media import MediaState, MediaType
|
||||||
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
||||||
|
@ -62,6 +62,13 @@ if VLC_AVAILABLE:
|
||||||
if LooseVersion(VERSION.split()[0]) < LooseVersion('1.1.0'):
|
if LooseVersion(VERSION.split()[0]) < LooseVersion('1.1.0'):
|
||||||
VLC_AVAILABLE = False
|
VLC_AVAILABLE = False
|
||||||
log.debug('VLC could not be loaded, because the vlc version is too old: %s' % VERSION)
|
log.debug('VLC could not be loaded, because the vlc version is too old: %s' % VERSION)
|
||||||
|
if is_linux():
|
||||||
|
import ctypes
|
||||||
|
try:
|
||||||
|
x11 = ctypes.cdll.LoadLibrary('libX11.so')
|
||||||
|
x11.XInitThreads()
|
||||||
|
except:
|
||||||
|
log.exception('Failed to XInitThreads(), VLC might not work properly!')
|
||||||
|
|
||||||
AUDIO_EXT = ['*.mp3', '*.wav', '*.wma', '*.ogg']
|
AUDIO_EXT = ['*.mp3', '*.wav', '*.wma', '*.ogg']
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue