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.display_name = u'&Phonon'
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.additional_extensions = ADDITIONAL_EXT
|
self.additional_extensions = ADDITIONAL_EXT
|
||||||
|
try:
|
||||||
mimetypes.init()
|
mimetypes.init()
|
||||||
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
|
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
|
||||||
mimetype = unicode(mimetype)
|
mimetype = unicode(mimetype)
|
||||||
@ -76,6 +77,11 @@ class PhononPlayer(MediaPlayer):
|
|||||||
self._addToList(self.audio_extensions_list, mimetype)
|
self._addToList(self.audio_extensions_list, mimetype)
|
||||||
elif mimetype.startswith(u'video/'):
|
elif mimetype.startswith(u'video/'):
|
||||||
self._addToList(self.video_extensions_list, mimetype)
|
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):
|
def _addToList(self, list, mimetype):
|
||||||
# Add all extensions which mimetypes provides us for supported types.
|
# Add all extensions which mimetypes provides us for supported types.
|
||||||
|
Loading…
Reference in New Issue
Block a user