[pitivi] Revert "pipeline: Keep track whether the pipeline has a duration"



commit 0a44c0d204e4866687785fe3850005a9c4dc18e9
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Fri Feb 14 02:31:47 2014 +0100

    Revert "pipeline: Keep track whether the pipeline has a duration"
    
    This reverts commit 6c3bde8d48dd637407481585b8198d9dea219005.

 pitivi/utils/pipeline.py |   27 +++++----------------------
 1 files changed, 5 insertions(+), 22 deletions(-)
---
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index ee80078..27d752d 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -24,17 +24,14 @@
 """
 High-level pipelines
 """
+from pitivi.utils.loggable import Loggable
+from pitivi.utils.signal import Signallable
+from pitivi.utils.misc import format_ns
 
-from gi.repository import GES
 from gi.repository import GLib
 from gi.repository import GObject
 from gi.repository import Gst
-from gi.repository import GstPbutils
-
-from pitivi.utils.loggable import Loggable
-from pitivi.utils.misc import format_ns
-from pitivi.utils.signal import Signallable
-
+from gi.repository import GES
 
 MAX_RECOVERIES = 5
 
@@ -169,7 +166,6 @@ class SimplePipeline(Signallable, Loggable):
         self._listening = False  # for the position handler
         self._listeningInterval = 300  # default 300ms
         self._listeningSigId = 0
-        self._has_duration = True
         self._duration = Gst.CLOCK_TIME_NONE
         self.lastPosition = long(0 * Gst.SECOND)
         self.pendingRecovery = False
@@ -401,10 +397,7 @@ class SimplePipeline(Signallable, Loggable):
 
         # clamp between [0, duration]
         if format == Gst.Format.TIME:
-            if self._has_duration:
-                position = max(0, min(position, self.getDuration()) - 1)
-            else:
-                position = max(0, position)
+            position = max(0, min(position, self.getDuration()) - 1)
 
         res = self._pipeline.seek(1.0, format, Gst.SeekFlags.FLUSH,
                                   Gst.SeekType.SET, position,
@@ -533,16 +526,6 @@ class AssetPipeline(SimplePipeline):
     def setClipUri(self, uri):
         self._pipeline.set_property("uri", uri)
 
-        discoverer = GstPbutils.Discoverer.new(Gst.SECOND)
-        info = discoverer.discover_uri(uri)
-        has_duration = False
-        if info:
-            videos = info.get_video_streams()
-            if videos:
-                video = videos[0]
-                has_duration = not video.is_image()
-        self._has_duration = has_duration
-
 
 class Pipeline(GES.Pipeline, SimplePipeline):
     """


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]