forked from openlp/openlp
Only allow Start / End times for videos under 50Meg in size.
Fixes: https://launchpad.net/bugs/730474
This commit is contained in:
parent
e943b0a1f6
commit
7fd5a1d7fe
@ -132,14 +132,18 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
self.mediaObject.play()
|
self.mediaObject.play()
|
||||||
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
|
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
|
||||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
||||||
service_item.add_capability(ItemCapabilities.AllowsVarableStartTime)
|
|
||||||
# force a nonexistent theme
|
# force a nonexistent theme
|
||||||
service_item.theme = -1
|
service_item.theme = -1
|
||||||
frame = u':/media/image_clapperboard.png'
|
frame = u':/media/image_clapperboard.png'
|
||||||
(path, name) = os.path.split(filename)
|
(path, name) = os.path.split(filename)
|
||||||
while not self.mediaState:
|
file_size = os.path.getsize(filename)
|
||||||
Receiver.send_message(u'openlp_process_events')
|
# File too big for processing
|
||||||
service_item.media_length = self.mediaLength
|
if file_size <= 52428800: # 50MiB
|
||||||
|
while not self.mediaState:
|
||||||
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
service_item.media_length = self.mediaLength
|
||||||
|
service_item.add_capability(
|
||||||
|
ItemCapabilities.AllowsVarableStartTime)
|
||||||
service_item.add_from_command(path, name, frame)
|
service_item.add_from_command(path, name, frame)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user