Permalink
Browse files

ui/previewer: handle seek failures.

  • Loading branch information...
1 parent 6439937 commit 9f8ab2ecddb897dd435d83a4f7a3ec3da4347e6a @alessandrod alessandrod committed Sep 10, 2010
Showing with 9 additions and 3 deletions.
  1. +9 −3 pitivi/ui/previewer.py
View
@@ -303,7 +303,9 @@ def _nextThumbnail(self):
the next thumbnail in the queue. This should always be called from the
main application thread."""
if self._queue:
- self._startThumbnail(self._queue[0])
+ if not self._startThumbnail(self._queue[0]):
+ self._queue.pop(0)
+ self._nextThumbnail()
return False
def _requestThumbnail(self, segment):
@@ -386,7 +388,7 @@ def _thumbnailCb(self, unused_thsink, pixbuf, timestamp):
def _startThumbnail(self, timestamp):
RandomAccessPreviewer._startThumbnail(self, timestamp)
- self.videopipeline.seek(1.0,
+ return self.videopipeline.seek(1.0,
gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE,
gst.SEEK_TYPE_SET, timestamp,
gst.SEEK_TYPE_NONE, -1)
@@ -453,13 +455,17 @@ def _busMessageErrorCb(self, bus, message):
def _startThumbnail(self, (timestamp, duration)):
RandomAccessPreviewer._startThumbnail(self, (timestamp, duration))
self._audio_cur = timestamp, duration
- self.audioPipeline.seek(1.0,
+ res = self.audioPipeline.seek(1.0,
gst.FORMAT_TIME,
gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE | gst.SEEK_FLAG_SEGMENT,
gst.SEEK_TYPE_SET, timestamp,
gst.SEEK_TYPE_SET, timestamp + duration)
+ if not res:
+ self.warning("seek failed %s", timestamp)
self.audioPipeline.set_state(gst.STATE_PLAYING)
+ return res
+
def _finishWaveform(self):
surfaces = []
surface = cairo.ImageSurface(cairo.FORMAT_A8,

0 comments on commit 9f8ab2e

Please sign in to comment.