msmith - in flumotion/trunk: . flumotion/component/producers/playlist flumotion/test

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Wed May 16 13:12:48 CEST 2007


Author: msmith
Date: Wed May 16 13:12:45 2007
New Revision: 4961

Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/component/producers/playlist/playlist.py
   flumotion/trunk/flumotion/component/producers/playlist/playlistparser.py
   flumotion/trunk/flumotion/test/test_component_playlist.py
Log:
        * flumotion/component/producers/playlist/playlist.py:
        * flumotion/component/producers/playlist/playlistparser.py:
        * flumotion/test/test_component_playlist.py:
          Fix up reflecting changes to playlist items back into the gnonlin
          objects.



Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Wed May 16 13:12:45 2007
@@ -1,5 +1,13 @@
 2007-05-16  Michael Smith <msmith at fluendo.com>
 
+	* flumotion/component/producers/playlist/playlist.py:
+	* flumotion/component/producers/playlist/playlistparser.py:
+	* flumotion/test/test_component_playlist.py:
+	  Fix up reflecting changes to playlist items back into the gnonlin
+	  objects.
+
+2007-05-16  Michael Smith <msmith at fluendo.com>
+
 	* flumotion/component/producers/playlist/playlistparser.py:
 	  Return new item from addItem (used in tests)
 	* flumotion/test/test_component_playlist.py:

Modified: flumotion/trunk/flumotion/component/producers/playlist/playlist.py
==============================================================================
--- flumotion/trunk/flumotion/component/producers/playlist/playlist.py	(original)
+++ flumotion/trunk/flumotion/component/producers/playlist/playlist.py	Wed May 16 13:12:45 2007
@@ -269,6 +269,18 @@
             asrc = self._asrcs.pop(item)
             self.audiocomp.remove(asrc)
 
+    def adjustItemScheduling(self, item):
+        if self._hasVideo and item.hasVideo:
+            vsrc = self._vsrcs[item]
+            vsrc.props.start = item.timestamp
+            vsrc.props.duration = item.duration
+            vsrc.props.media_duration = item.duration
+        if self._hasAudio and item.hasAudio:
+            asrc = self._asrcs[item]
+            asrc.props.start = item.timestamp
+            asrc.props.duration = item.duration
+            asrc.props.media_duration = item.duration
+
     def addPlaylist(self, data):
         self.playlistparser.parseData(data)
 

Modified: flumotion/trunk/flumotion/component/producers/playlist/playlistparser.py
==============================================================================
--- flumotion/trunk/flumotion/component/producers/playlist/playlistparser.py	(original)
+++ flumotion/trunk/flumotion/component/producers/playlist/playlistparser.py	Wed May 16 13:12:45 2007
@@ -147,6 +147,7 @@
             self.debug("Changing duration of previous item from %d to %d", 
                 prev.duration, newitem.timestamp - prev.timestamp)
             prev.duration = newitem.timestamp - prev.timestamp
+            self.producer.adjustItemScheduling(prev)
 
         if next and newitem.timestamp + newitem.duration > next.timestamp:
             self.debug("Changing timestamp of next item from %d to %d to fit", 
@@ -155,6 +156,7 @@
             duration = next.duration - (ts - next.timestamp)
             next.duration = duration
             next.timestamp = ts
+            self.producer.adjustItemScheduling(next)
 
         # Then we need to actually add newitem into the gnonlin timeline
         self.producer.scheduleItem(newitem)

Modified: flumotion/trunk/flumotion/test/test_component_playlist.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_component_playlist.py	(original)
+++ flumotion/trunk/flumotion/test/test_component_playlist.py	Wed May 16 13:12:45 2007
@@ -35,6 +35,9 @@
     def unscheduleItem(self, item):
         pass
 
+    def adjustItemScheduling(self, item):
+        pass
+
 class TestPlaylist(unittest.TestCase):
     def setUp(self):
         producer = FakeProducer()


More information about the flumotion-commit mailing list