Author: tack
Date: Thu Dec 28 17:37:16 2006
New Revision: 2295

Modified:
   trunk/metadata/src/video/core.py

Log:
Remove unnecessary loop in finalize (used to be responsible for converting
all lengths to int, which is not something kaa.metadata should do); if
container length is undefined, pick largest of is tracks, rather than the
first track.


Modified: trunk/metadata/src/video/core.py
==============================================================================
--- trunk/metadata/src/video/core.py    (original)
+++ trunk/metadata/src/video/core.py    Thu Dec 28 17:37:16 2006
@@ -98,7 +98,9 @@
         """
         Media._finalize(self)
         if not self.length and len(self.video) and self.video[0].length:
-            self.length = self.video[0].length
-        for container in [ self ] + self.video + self.audio:
-            if container.length:
-                container.length = container.length
+            self.length = 0
+            # Length not specified for container, so use the largest length
+            # of its tracks as container length.
+            for track in self.video + self.audio:
+                if track.length:
+                    self.length = max(self.length, track.length)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to