[Sugar-devel] [PATCH Portfolio] Fix position and duration query
Daniel Drake
dsd at laptop.org
Sat May 25 10:37:39 EDT 2013
The API changed slightly in gstreamer-1.0.
This fixes audio recording.
---
grecord.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
Now that we are on gstreamer-1.0 it may be worth revisiting if the "EOS
stopped advancing" workaround is needed. I'm suspicious of that code and
in this case it was the item that was being confused by the API change.
diff --git a/grecord.py b/grecord.py
index 92a4a75..05ccacb 100644
--- a/grecord.py
+++ b/grecord.py
@@ -212,14 +212,12 @@ filesink name=audioFilesink'
return True
def _query_position(self, pipe):
- try:
- position, format = pipe.query_position(Gst.Format.TIME)
- except:
+ result, position = pipe.query_position(Gst.Format.TIME)
+ if not result:
position = Gst.CLOCK_TIME_NONE
- try:
- duration, format = pipe.query_duration(Gst.Format.TIME)
- except:
+ result, duration = pipe.query_duration(Gst.Format.TIME)
+ if not result:
duration = Gst.CLOCK_TIME_NONE
return (position, duration)
--
1.8.1.4
More information about the Sugar-devel
mailing list