Only allow Start / End times for videos under 50Meg in size.

Fixes: https://launchpad.net/bugs/730474
This commit is contained in:
Tim Bentley 2011-03-15 07:30:03 +00:00
parent e943b0a1f6
commit 7fd5a1d7fe
1 changed files with 8 additions and 4 deletions

View File

@ -132,14 +132,18 @@ class MediaMediaItem(MediaManagerItem):
self.mediaObject.play()
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
service_item.add_capability(ItemCapabilities.RequiresMedia)
service_item.add_capability(ItemCapabilities.AllowsVarableStartTime)
# force a nonexistent theme
service_item.theme = -1
frame = u':/media/image_clapperboard.png'
(path, name) = os.path.split(filename)
while not self.mediaState:
Receiver.send_message(u'openlp_process_events')
service_item.media_length = self.mediaLength
file_size = os.path.getsize(filename)
# File too big for processing
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)
return True
else: