forked from openlp/openlp
Add time to media loop as a guard
bzr-revno: 1402
This commit is contained in:
commit
adaddf8eab
@ -24,6 +24,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -139,8 +140,13 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
file_size = os.path.getsize(filename)
|
file_size = os.path.getsize(filename)
|
||||||
# File too big for processing
|
# File too big for processing
|
||||||
if file_size <= 52428800: # 50MiB
|
if file_size <= 52428800: # 50MiB
|
||||||
|
start = datetime.now()
|
||||||
while not self.mediaState:
|
while not self.mediaState:
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
tme = datetime.now() - start
|
||||||
|
if tme.seconds > 5:
|
||||||
|
break
|
||||||
|
if self.mediaState:
|
||||||
service_item.media_length = self.mediaLength
|
service_item.media_length = self.mediaLength
|
||||||
service_item.add_capability(
|
service_item.add_capability(
|
||||||
ItemCapabilities.AllowsVariableStartTime)
|
ItemCapabilities.AllowsVariableStartTime)
|
||||||
|
Loading…
Reference in New Issue
Block a user