[pitivi] viewer: Do not use an extra variable to check if we are in trimming preview mode



commit f8aa183bc89820b6979fbceae3b08ac0cfae8bd4
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Fri May 18 13:11:53 2012 -0400

    viewer: Do not use an extra variable to check if we are in trimming preview mode
    
    This avoids to forget to reset this extra variable
    
    	+ Set pipeline state to NULL before droping its last reference

 pitivi/viewer.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index 3a4493a..d4775ef 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -395,10 +395,8 @@ class PitiviViewer(gtk.VBox, Loggable):
         """
         While a clip is being trimmed, show a live preview of it.
         """
-        self._clipTrimPreviewed = True
         if tl_obj.props.is_image or not hasattr(tl_obj, "get_uri"):
             self.log("%s is an image or has no URI, so not previewing trim" % tl_obj)
-            self._clipTrimPreviewed = False
             return False
 
         clip_uri = tl_obj.props.uri
@@ -421,7 +419,8 @@ class PitiviViewer(gtk.VBox, Loggable):
         """
         After trimming a clip, reset the project pipeline into the viewer.
         """
-        if self._clipTrimPreviewed:
+        if self._tmp_pipeline is not None:
+            self._tmp_pipeline.set_state(gst.STATE_NULL)
             self._tmp_pipeline = None  # Free the memory
             self.setPipeline(self.app.current.pipeline, self._oldTimelinePos)
             self.debug("Back to old pipeline")



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