[pitivi: 3/12] discoverer: handle state change failure going to PLAYING.



commit fa7786ffe607f2b897bf512b0cd07e5a5c64bfbd
Author: Alessandro Decina <alessandro d gmail com>
Date:   Sat Mar 6 00:44:42 2010 +0100

    discoverer: handle state change failure going to PLAYING.

 pitivi/discoverer.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/discoverer.py b/pitivi/discoverer.py
index 3132071..b4894e2 100644
--- a/pitivi/discoverer.py
+++ b/pitivi/discoverer.py
@@ -484,7 +484,11 @@ class Discoverer(Signallable, Loggable):
             have_video, have_audio, have_image = self._getCurrentStreamTypes()
             if self.unfixed_pads or have_video or have_image:
                 # go to PLAYING to generate the thumbnails
-                self.pipeline.set_state(gst.STATE_PLAYING)
+                if self.pipeline.set_state(gst.STATE_PLAYING) == gst.STATE_CHANGE_FAILURE:
+                    if not self.error:
+                        self.error = _("Pipeline didn't want to go to PLAYING.")
+                    self.info("Pipeline didn't want to go to PAUSED")
+                    self._finishAnalysis("failure going to PAUSED")
             elif self.unfixed_pads == 0:
                 # check for unfixed_pads until elements are fixed to do
                 # negotiation before pushing in band data



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