shorter solution

This commit is contained in:
Andreas Preikschat 2012-04-28 15:10:54 +02:00
parent 9dc7d1a795
commit 9668b22f85

View File

@ -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
@ -52,16 +53,12 @@ except OSError, e:
raise raise
if VLC_AVAILABLE: if VLC_AVAILABLE:
try:
# Older versions of vlc fail here.
vlcInstance = vlc.Instance()
vlcInstance.media_player_new()
except AttributeError:
VLC_AVAILABLE = False
version = u'0.0.0'
try: try:
version = vlc.libvlc_get_version() version = vlc.libvlc_get_version()
finally: except:
version = u'0.0.0'
if LooseVersion(version) < '1.1.0':
VLC_AVAILABLE = False
log.debug(u'VLC could not be loaded: %s' % version) log.debug(u'VLC could not be loaded: %s' % version)
AUDIO_EXT = [ AUDIO_EXT = [