← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 598: Changed all IN and OUT attributes in the XML to be Integers, since they all represent frame numbe...

 

------------------------------------------------------------
revno: 598
fixes bug: https://launchpad.net/bugs/902971
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Sun 2011-12-18 15:20:16 -0600
message:
  Changed all IN and OUT attributes in the XML to be Integers, since they all represent frame numbers.  In a future version of MLT, the decimals in the IN/OUT will cause some issues.
modified:
  openshot/classes/clip.py
  openshot/classes/effect.py
  openshot/classes/keyframe.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/clip.py'
--- openshot/classes/clip.py	2011-12-11 21:38:46 +0000
+++ openshot/classes/clip.py	2011-12-18 21:20:16 +0000
@@ -407,8 +407,8 @@
 		producer = dom.createElement("producer")
 		producer.setAttribute("id", self.unique_id)
 		producer.setAttribute("novdpau", "1")
-		producer.setAttribute("in", str(in_frame_number))
-		producer.setAttribute("out", str(out_frame_number))
+		producer.setAttribute("in", str(int(round(in_frame_number))))
+		producer.setAttribute("out", str(int(round(out_frame_number))))
 		
 		# hide video (if needed)
 		if self.play_video == False or self.parent.play_video == False:
@@ -493,8 +493,8 @@
 				# MUTE
 				filter = dom.createElement("filter")
 				filter.setAttribute("mlt_service", "volume")
-				filter.setAttribute("in", str(trans_in_frame_number))
-				filter.setAttribute("out", str(trans_out_frame_number))
+				filter.setAttribute("in", str(int(round(trans_in_frame_number))))
+				filter.setAttribute("out", str(int(round(trans_out_frame_number))))
 				filter.setAttribute("track", str(track_index_flipped))
 				filter.setAttribute("gain", locale.str(0))
 				
@@ -508,15 +508,15 @@
 					# FADE IN
 					filter = dom.createElement("filter")
 					filter.setAttribute("mlt_service", "volume")
-					filter.setAttribute("in", str(current_audio_frame))
+					filter.setAttribute("in", str(int(round(current_audio_frame))))
 					if current_audio_frame + (self.audio_fade_amount * fps) <= trans_out_frame_number:
 						# ADD FADE AMOUNT
 						current_audio_frame = current_audio_frame + round(self.audio_fade_amount * fps)
-						filter.setAttribute("out", str(current_audio_frame))
+						filter.setAttribute("out", str(int(round(current_audio_frame))))
 					else:
 						# ADJUST FADE AMOUNT TO FIT SMALLER TIME
 						current_audio_frame = trans_out_frame_number
-						filter.setAttribute("out", str(current_audio_frame))
+						filter.setAttribute("out", str(int(round(current_audio_frame))))
 					filter.setAttribute("track", str(track_index_flipped))
 					filter.setAttribute("gain", locale.str(0))
 					filter.setAttribute("end", locale.str(self.volume / 100))
@@ -531,9 +531,9 @@
 					
 					filter = dom.createElement("filter")
 					filter.setAttribute("mlt_service", "volume")
-					filter.setAttribute("in", str(current_audio_frame))
+					filter.setAttribute("in", str(int(round(current_audio_frame))))
 					current_audio_frame = trans_out_frame_number - round(self.audio_fade_amount * fps)
-					filter.setAttribute("out", str(current_audio_frame))
+					filter.setAttribute("out", str(int(round(current_audio_frame))))
 					filter.setAttribute("track", str(track_index_flipped))
 					filter.setAttribute("gain", locale.str(self.volume / 100))
 					
@@ -546,9 +546,9 @@
 	
 					filter = dom.createElement("filter")
 					filter.setAttribute("mlt_service", "volume")
-					filter.setAttribute("in", str(current_audio_frame))
+					filter.setAttribute("in", str(int(round(current_audio_frame))))
 					current_audio_frame = trans_out_frame_number
-					filter.setAttribute("out", str(current_audio_frame))
+					filter.setAttribute("out", str(int(round(current_audio_frame))))
 					filter.setAttribute("track", str(track_index_flipped))
 					filter.setAttribute("gain", locale.str(self.volume / 100))
 					
@@ -562,9 +562,9 @@
 					# FADE OUT
 					filter = dom.createElement("filter")
 					filter.setAttribute("mlt_service", "volume")
-					filter.setAttribute("in", str(current_audio_frame))
+					filter.setAttribute("in", str(int(round(current_audio_frame))))
 					current_audio_frame = trans_out_frame_number
-					filter.setAttribute("out", str(current_audio_frame))
+					filter.setAttribute("out", str(int(round(current_audio_frame))))
 					filter.setAttribute("track", str(track_index_flipped))
 					filter.setAttribute("gain", locale.str(self.volume / 100))
 					filter.setAttribute("end", locale.str(0))
@@ -637,8 +637,8 @@
 				#			 MIX
 				##############################
 				transition = dom.createElement("transition")
-				transition.setAttribute("in", str(trans_in_frame_number))
-				transition.setAttribute("out", str(trans_out_frame_number))
+				transition.setAttribute("in", str(int(round(trans_in_frame_number))))
+				transition.setAttribute("out", str(int(round(trans_out_frame_number))))
 				
 				property = dom.createElement("property")
 				property.setAttribute("name", "mlt_service")
@@ -827,8 +827,8 @@
 			track_index_flipped = 0
 		
 		transition = dom.createElement("transition")
-		transition.setAttribute("in", str(round(trans_in_frame_number)))
-		transition.setAttribute("out", str(round(trans_out_frame_number)))
+		transition.setAttribute("in", str(int(round(trans_in_frame_number))))
+		transition.setAttribute("out", str(int(round(trans_out_frame_number))))
 		
 		property = dom.createElement("property")
 		property.setAttribute("name", "mlt_service")

=== modified file 'openshot/classes/effect.py'
--- openshot/classes/effect.py	2011-09-04 05:50:51 +0000
+++ openshot/classes/effect.py	2011-12-18 21:20:16 +0000
@@ -77,8 +77,8 @@
 		# create effect node
 		filter_root = dom.createElement("filter")
 		filter_root.setAttribute("mlt_service", service)
-		filter_root.setAttribute("in", str(in_frame))
-		filter_root.setAttribute("out", str(out_frame))
+		filter_root.setAttribute("in", str(int(round(in_frame))))
+		filter_root.setAttribute("out", str(int(round(out_frame))))
 		filter_root.setAttribute("track", str(track))
 		
 		if not audio_effect:

=== modified file 'openshot/classes/keyframe.py'
--- openshot/classes/keyframe.py	2011-01-12 07:48:10 +0000
+++ openshot/classes/keyframe.py	2011-12-18 21:20:16 +0000
@@ -52,7 +52,7 @@
 		""" Generate the MLT keyframe string for the XML: 0=0%,0%:100%x100%:100; -1=0%,0%:100%x100%:100 """
 		
 		# generate string
-		output = "%d=%s%%,%s%%:%s%%x%s%%:%s; " % (self.frame, locale.str(self.x), locale.str(self.y), locale.str(self.width), locale.str(self.height), locale.str(self.alpha * 100.0))
+		output = "%d=%s%%,%s%%:%s%%x%s%%:%s; " % (int(round(self.frame)), locale.str(self.x), locale.str(self.y), locale.str(self.width), locale.str(self.height), locale.str(self.alpha * 100.0))
 		
 		# return string
 		return output