forked from openlp/openlp
Fix #963894: disable vlc backend completely for osx.
This commit is contained in:
parent
f51f19e2b9
commit
41980a3a46
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, translate
|
from openlp.core.lib import OpenLPToolbar, Receiver, translate
|
||||||
|
@ -105,6 +106,10 @@ class MediaController(object):
|
||||||
AppLocation.get_directory(AppLocation.AppDir),
|
AppLocation.get_directory(AppLocation.AppDir),
|
||||||
u'core', u'ui', u'media')
|
u'core', u'ui', u'media')
|
||||||
for filename in os.listdir(controller_dir):
|
for filename in os.listdir(controller_dir):
|
||||||
|
# TODO vlc backend is not yet working on Mac OS X.
|
||||||
|
# For now just ignore vlc backend on Mac OS X.
|
||||||
|
if sys.platform == 'darwin' and filename == 'vlcplayer.py':
|
||||||
|
continue
|
||||||
if filename.endswith(u'player.py') and not \
|
if filename.endswith(u'player.py') and not \
|
||||||
filename == 'media_player.py':
|
filename == 'media_player.py':
|
||||||
path = os.path.join(controller_dir, filename)
|
path = os.path.join(controller_dir, filename)
|
||||||
|
@ -115,7 +120,7 @@ class MediaController(object):
|
||||||
try:
|
try:
|
||||||
__import__(modulename, globals(), locals(), [])
|
__import__(modulename, globals(), locals(), [])
|
||||||
# On some platforms importing vlc.py might cause
|
# On some platforms importing vlc.py might cause
|
||||||
# also OSError exception. (e.g. Mac OS X)
|
# also OSError exceptions. (e.g. Mac OS X)
|
||||||
except (ImportError, OSError):
|
except (ImportError, OSError):
|
||||||
log.warn(u'Failed to import %s on path %s',
|
log.warn(u'Failed to import %s on path %s',
|
||||||
modulename, path)
|
modulename, path)
|
||||||
|
|
Loading…
Reference in New Issue