← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 606: Applied patch from Gleb Smirnoff (glebius) to report invalid MLT producers, instead of just crash...

 

------------------------------------------------------------
revno: 606
fixes bug: https://launchpad.net/bugs/893719
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Mon 2012-01-02 01:20:17 -0600
message:
  Applied patch from Gleb Smirnoff (glebius) to report invalid MLT producers, instead of just crashing.  This patch does not prevent a crash when using non-UTF filenames, but it adds a stdout message to assist the user.
modified:
  openshot/classes/cli_render.py
  openshot/classes/thumbnail.py
  openshot/classes/video.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/cli_render.py'
--- openshot/classes/cli_render.py	2010-04-03 18:52:42 +0000
+++ openshot/classes/cli_render.py	2012-01-02 07:20:17 +0000
@@ -265,6 +265,9 @@
 		# Create producer and initialize mlt
 		self.f = mlt.Factory().init()
 		self.p = mlt.Producer( self.profile, 'xml:%s' % self.file_name)
+		if self.p.is_valid() == False:
+			print "MLT producer failure"
+			sys.exit()
 		self.p.set_speed(0)
 		out_folder = self.render_options["folder"]
 		out_file = self.render_options["file"]

=== modified file 'openshot/classes/thumbnail.py'
--- openshot/classes/thumbnail.py	2011-12-11 21:38:46 +0000
+++ openshot/classes/thumbnail.py	2012-01-02 07:20:17 +0000
@@ -176,7 +176,11 @@
 				# mark as image seq
 				self.label = "Image Sequence"
 				self.file_type = "image sequence"
-			
+
+			# Check if clip is valid (otherwise a seg fault)
+			if self.p.is_valid() == False:
+				return None
+
 			# connect the producer and consumer
 			self.c.connect( self.p )
 
@@ -285,6 +289,10 @@
 		
 		#get the frame
 		self.p = self.p.cut(frame, frame)
+
+		# Check if clip is valid (otherwise a seg fault)
+		if self.p.is_valid() == False:
+			return None
 		
 		# connect the producer and consumer
 		self.c.connect( self.p )

=== modified file 'openshot/classes/video.py'
--- openshot/classes/video.py	2011-01-14 06:27:08 +0000
+++ openshot/classes/video.py	2012-01-02 07:20:17 +0000
@@ -114,6 +114,9 @@
 	
 			# Create the producer
 			self.p = mlt.Producer( self.profile, 'xml:%s' % self.file_name)
+			if self.p.is_valid() == False:
+				print "ERROR WITH %s" % self.file_name
+				return
 
 			# get export file path
 			folder = self.render_options["folder"]
@@ -171,6 +174,9 @@
 			
 			# Create the producer
 			self.p = mlt.Producer( self.profile, 'xml:%s' % self.file_name)
+			if self.p.is_valid() == False:
+				print "ERROR WITH %s" % self.file_name
+				return
 
 			# refresh sdl and pause video
 			self.pause()