Commit 227bf9d7 authored by Edward Hervey's avatar Edward Hervey

* pitivi/discoverer.py:

* pitivi/playground.py:
Ignore error messages coming from GstQueue. Hopefully these hacks will
go away once we can depend on GStreamer core >= 0.10.7
If query_position() returns -1, don't emit position update.


git-svn-id: svn+ssh://svn.gnome.org/svn/pitivi/trunk@782 d3729300-e425-0410-8a4c-d956edccc248
parent 56c1c1bd
2006-05-17 Edward Hervey <edward@fluendo.com>
* pitivi/discoverer.py:
* pitivi/playground.py:
Ignore error messages coming from GstQueue. Hopefully these hacks will
go away once we can depend on GStreamer core >= 0.10.7
If query_position() returns -1, don't emit position update.
2006-05-17 Edward Hervey <edward@fluendo.com>
* pitivi/playground.py:
......
......@@ -77,6 +77,10 @@ class Discoverer(gobject.GObject):
self.thisdone = False
self.timeoutid = 0
# FIXME : CRACK CRACK
# We want to ignore error messages coming from queue (fixing in 0.10.6.1)
self._queuetype = type(gst.element_factory_make("queue"))
def addFile(self, filename):
""" queue a filename to be discovered """
gst.info("filename: %s" % filename)
......@@ -222,8 +226,10 @@ class Discoverer(gobject.GObject):
self.currentfactory.setThumbnail(filename)
gobject.idle_add(self._finishAnalysis)
elif message.type == gst.MESSAGE_ERROR:
error, detail = message.parse_error()
self._handleError(error, detail, message.src)
# Fix until we can depend on GStreamer >= 0.10.7
if not isinstance(message.src, self._queuetype):
error, detail = message.parse_error()
self._handleError(error, detail, message.src)
elif message.type == gst.MESSAGE_WARNING:
gst.warning("got a WARNING")
elif message.type == gst.MESSAGE_ELEMENT:
......
......@@ -95,6 +95,10 @@ class PlayGround(gobject.GObject):
self.state = gst.STATE_READY
# FIXME : THIS IS CRACK, THIS IS CRACK
# This is so we have the GstQueue type handy
self._queuetype = type(gst.element_factory_make("queue"))
# handle for the position g_timeout_add()
self._positiontimeoutid = 0
......@@ -287,8 +291,11 @@ class PlayGround(gobject.GObject):
except:
self.current.warning("Couldn't get position in time")
cur = 0
gst.log("emitting 'position' with value %s" % gst.TIME_ARGS(cur))
self.emit('position', self.current, cur)
if cur == -1:
gst.warning("seeking returned GST_CLOCK_TIME_NONE")
else:
gst.log("emitting 'position' with value %s" % gst.TIME_ARGS(cur))
self.emit('position', self.current, cur)
# hit me !
return True
......@@ -326,6 +333,9 @@ class PlayGround(gobject.GObject):
Uses the information from the Gerror, detail and source to
create meaningful error messages for the User Interface.
"""
# FIME : This will be solved in 0.10.7
if isinstance(source, self._queuetype):
return
gst.warning("gerror:%s , detail:%s , source:%s" % (gerror, detail, source))
gst.warning("GError : code:%s, domain:%s (%s), message:%s" % (gerror.code, gerror.domain,
type(gerror.domain), gerror.message))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment