forked from openlp/openlp
Fixes #1154059
This commit is contained in:
parent
46b3552c2c
commit
2c01be044c
@ -69,6 +69,7 @@ class PhononPlayer(MediaPlayer):
|
||||
self.display_name = u'&Phonon'
|
||||
self.parent = parent
|
||||
self.additional_extensions = ADDITIONAL_EXT
|
||||
try:
|
||||
mimetypes.init()
|
||||
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
|
||||
mimetype = unicode(mimetype)
|
||||
@ -76,6 +77,11 @@ class PhononPlayer(MediaPlayer):
|
||||
self._addToList(self.audio_extensions_list, mimetype)
|
||||
elif mimetype.startswith(u'video/'):
|
||||
self._addToList(self.video_extensions_list, mimetype)
|
||||
except UnicodeDecodeError:
|
||||
log.exception(u'UnicodeDecodeError when trying to read mime types.'
|
||||
' Setting extensions to all files')
|
||||
self.audio_extensions_list = [u'*']
|
||||
self.video_extensions_list = [u'*']
|
||||
|
||||
def _addToList(self, list, mimetype):
|
||||
# Add all extensions which mimetypes provides us for supported types.
|
||||
|
Loading…
Reference in New Issue
Block a user