[PATCH Portfolio] Fix position and duration query
Daniel Drake <dsd <at> laptop.org>
2013-05-25 14:37:39 GMT
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
<at> <at> -212,14 +212,12 <at> <at> 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