* morituri/common/encode.py:
Query for duration and use it in level callback to set progress. Works around F-15 bug where encode progress is not being updated.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2011-05-24 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* morituri/common/encode.py:
|
||||||
|
Query for duration and use it in level callback to set progress.
|
||||||
|
Works around F-15 bug where encode progress is not being updated.
|
||||||
|
|
||||||
2011-05-24 Thomas Vander Stichele <thomas at apestaart dot org>
|
2011-05-24 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* morituri/rip/Makefile.am:
|
* morituri/rip/Makefile.am:
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ class EncodeTask(gstreamer.GstPipelineTask):
|
|||||||
self.stop()
|
self.stop()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# wavparse 0.10.14 returns in bytes
|
# wavparse 0.10.14 returns in bytes
|
||||||
if qformat == self.gst.FORMAT_BYTES:
|
if qformat == self.gst.FORMAT_BYTES:
|
||||||
self.debug('query returned in BYTES format')
|
self.debug('query returned in BYTES format')
|
||||||
@@ -201,6 +202,13 @@ class EncodeTask(gstreamer.GstPipelineTask):
|
|||||||
self.debug('total length: %r', length)
|
self.debug('total length: %r', length)
|
||||||
self._length = length
|
self._length = length
|
||||||
|
|
||||||
|
duration = None
|
||||||
|
try:
|
||||||
|
duration, qformat = identity.query_duration(self.gst.FORMAT_TIME)
|
||||||
|
except self.gst.QueryError, e:
|
||||||
|
self.debug('Could not query duration')
|
||||||
|
self._duration = duration
|
||||||
|
|
||||||
# set up level callbacks
|
# set up level callbacks
|
||||||
# FIXME: publicize bus and reuse it instead of regetting and adding ?
|
# FIXME: publicize bus and reuse it instead of regetting and adding ?
|
||||||
bus = self.pipeline.get_bus()
|
bus = self.pipeline.get_bus()
|
||||||
@@ -246,6 +254,12 @@ class EncodeTask(gstreamer.GstPipelineTask):
|
|||||||
self.log('higher peakdB found, now %r', self._peakdB)
|
self.log('higher peakdB found, now %r', self._peakdB)
|
||||||
self._peakdB = p
|
self._peakdB = p
|
||||||
|
|
||||||
|
# FIXME: works around a bug on F-15 where buffer probes don't seem
|
||||||
|
# to get triggered to update progress
|
||||||
|
if self._duration is not None:
|
||||||
|
self.schedule(0, self.setProgress,
|
||||||
|
float(s['stream-time'] + s['duration']) / self._duration)
|
||||||
|
|
||||||
def stopped(self):
|
def stopped(self):
|
||||||
if self._peakdB is not None:
|
if self._peakdB is not None:
|
||||||
self.debug('peakdB %r', self._peakdB)
|
self.debug('peakdB %r', self._peakdB)
|
||||||
|
|||||||
Reference in New Issue
Block a user