Short circuit retrival of position when we are in stopped state, should fix #87

This commit is contained in:
Thomas Adamcik 2011-05-02 23:49:39 +02:00
parent f39d98f505
commit e57f3f39c4

View File

@ -169,6 +169,8 @@ class GStreamer(ThreadingActor):
self.gst_pipeline.get_by_name('source').emit('end-of-stream')
def get_position(self):
if self.gst_pipeline.get_state()[1] == gst.STATE_NULL:
return 0
try:
position = self.gst_pipeline.query_position(gst.FORMAT_TIME)[0]
return position // gst.MSECOND