This commit is contained in:
Tim Bentley 2016-01-23 12:11:34 +00:00
parent 06ed550c8f
commit 4aebe441e7
4 changed files with 5 additions and 15 deletions

View File

@ -543,7 +543,6 @@ class ServiceItem(RegistryProperties):
:param length: The length of the media item
"""
print("set_media_length " + str(length) + " " + self.processor)
print("set_media_length " + str(self.start_time) + " " + str(self.end_time))
self.media_length = length
if length > 0:
self.add_capability(ItemCapabilities.HasVariableStartTime)

View File

@ -452,8 +452,9 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties):
translate('MediaPlugin.MediaItem', 'Unsupported File'))
return False
media_data = MediaInfoWrapper.parse(service_item.get_frame_path())
print(media_data.to_data())
# duration returns in nano seconds
service_item.set_media_length(media_data.tracks[0].duration // 1000)
service_item.set_media_length(media_data.tracks[0].duration)
log.debug('use %s controller' % self.current_media_players[controller.controller_type])
return True
@ -537,7 +538,6 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties):
if not title:
continue
player = self.media_players[title]
print(player)
# The system player may not return what files it can play so add it now
# and check whether it can play the file later
if title == 'system':

View File

@ -4,14 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
# Copyright (c) 2008-2016 OpenLP Developers #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #

View File

@ -273,10 +273,8 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties):
service_item.processor = self.display_type_combo_box.currentText()
service_item.add_from_command(path, name, CLAPPERBOARD)
# Only get start and end times if going to a service
if context == ServiceItemContext.Service:
# Start media and obtain the length
if not self.media_controller.media_length(service_item):
return False
if not self.media_controller.media_length(service_item):
return False
service_item.add_capability(ItemCapabilities.CanAutoStartForLive)
service_item.add_capability(ItemCapabilities.CanEditTitle)
service_item.add_capability(ItemCapabilities.RequiresMedia)