← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 647: Added a check on the MLT 'seekable' property when importing files. If the file is not seekable, i...

 

------------------------------------------------------------
revno: 647
fixes bug: https://launchpad.net/bugs/876712
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Thu 2012-03-22 21:39:12 +0000
message:
  Added a check on the MLT 'seekable' property when importing files. If the file is not seekable, it is a good indication that the file wil not work properly in OpenShot - file playback should be ok, but seeking/trimming will probably not work.
  In the case of it not being seekable, a warning is flashed up to the user.
  Also removed some old commented out code.
modified:
  openshot/classes/thumbnail.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/classes/thumbnail.py'
--- openshot/classes/thumbnail.py	2012-01-02 07:20:17 +0000
+++ openshot/classes/thumbnail.py	2012-03-22 21:39:12 +0000
@@ -18,7 +18,7 @@
 
 import os, threading, time
 from PIL import Image
-from classes import files, profiles
+from classes import files, profiles, messagebox
 
 try:
 	import mlt
@@ -84,6 +84,11 @@
 			if self.p.is_valid() == False:
 				return None
 			
+			# check the 'seekable' property
+			# If it is zero, then MLT is likely to have problems with this file.
+			if self.p.get("seekable") == '0':
+				messagebox.show(_("Warning!"), _("The file %s has properties that may prevent it working properly in OpenShot.\nYou may need to transcode it to another format.") % (self.file_name))
+				
 			# create the consumer
 			self.c = mlt.Consumer(self.profile, "avformat", self.thumbnail_path)
 
@@ -136,13 +141,6 @@
 				is_image = True
 				self.file_type = "image"	
 
-			# determine if this is an image
-			#is_image = False
-			#if self.p.get_length() == 15000:
-				# images always have exactly 15000 frames
-				#is_image = True
-				#self.file_type = "image"
-				
 				# set the max length of the image to 300 seconds (i.e. 5 minutes)
 				max_frames = producer_fps * 300