forked from openlp/openlp
shorter solution
This commit is contained in:
parent
9dc7d1a795
commit
9668b22f85
@ -26,6 +26,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from distutils.version import LooseVersion
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -53,16 +54,12 @@ except OSError, e:
|
|||||||
|
|
||||||
if VLC_AVAILABLE:
|
if VLC_AVAILABLE:
|
||||||
try:
|
try:
|
||||||
# Older versions of vlc fail here.
|
version = vlc.libvlc_get_version()
|
||||||
vlcInstance = vlc.Instance()
|
except:
|
||||||
vlcInstance.media_player_new()
|
|
||||||
except AttributeError:
|
|
||||||
VLC_AVAILABLE = False
|
|
||||||
version = u'0.0.0'
|
version = u'0.0.0'
|
||||||
try:
|
if LooseVersion(version) < '1.1.0':
|
||||||
version = vlc.libvlc_get_version()
|
VLC_AVAILABLE = False
|
||||||
finally:
|
log.debug(u'VLC could not be loaded: %s' % version)
|
||||||
log.debug(u'VLC could not be loaded: %s' % version)
|
|
||||||
|
|
||||||
AUDIO_EXT = [
|
AUDIO_EXT = [
|
||||||
u'*.mp3'
|
u'*.mp3'
|
||||||
|
Loading…
Reference in New Issue
Block a user