forked from openlp/openlp
Drop mediainfo system() support
Drop the support to call the mediainfo binary that is not included in the installers anymore.
This commit is contained in:
parent
aa6107cea7
commit
8f934c6695
@ -29,7 +29,6 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pymediainfo_available = False
|
pymediainfo_available = False
|
||||||
|
|
||||||
from subprocess import check_output
|
|
||||||
from PyQt5 import QtCore
|
from PyQt5 import QtCore
|
||||||
|
|
||||||
from openlp.core.state import State
|
from openlp.core.state import State
|
||||||
@ -323,13 +322,9 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
if MediaInfo.can_parse():
|
if MediaInfo.can_parse():
|
||||||
media_data = MediaInfo.parse(media_path)
|
media_data = MediaInfo.parse(media_path)
|
||||||
else:
|
|
||||||
xml = check_output(['mediainfo', '-f', '--Output=XML', '--Inform=OLDXML', media_path])
|
|
||||||
if not xml.startswith(b'<?xml'):
|
|
||||||
xml = check_output(['mediainfo', '-f', '--Output=XML', media_path])
|
|
||||||
media_data = MediaInfo(xml.decode("utf-8"))
|
|
||||||
# duration returns in milli seconds
|
# duration returns in milli seconds
|
||||||
return media_data.tracks[0].duration
|
return media_data.tracks[0].duration
|
||||||
|
return 0
|
||||||
|
|
||||||
def media_setup_optical(self, filename, title, audio_track, subtitle_track, start, end, display, controller):
|
def media_setup_optical(self, filename, title, audio_track, subtitle_track, start, end, display, controller):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user