[SCM] morituri/master: * 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.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:29 UTC 2014


The following commit has been merged in the master branch:
commit 3fccbac3676e1dd7e99ce521124e66615b4e0809
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Tue May 24 17:00:04 2011 +0000

    	* 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.

diff --git a/ChangeLog b/ChangeLog
index 982faaa..664f351 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 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>
+
 	* morituri/rip/Makefile.am:
 	* morituri/rip/main.py:
 	* morituri/rip/debug.py (added):
diff --git a/morituri/common/encode.py b/morituri/common/encode.py
index 17d0d0e..f32ccff 100644
--- a/morituri/common/encode.py
+++ b/morituri/common/encode.py
@@ -194,6 +194,7 @@ class EncodeTask(gstreamer.GstPipelineTask):
             self.stop()
             return
 
+
         # wavparse 0.10.14 returns in bytes
         if qformat == self.gst.FORMAT_BYTES:
             self.debug('query returned in BYTES format')
@@ -201,6 +202,13 @@ class EncodeTask(gstreamer.GstPipelineTask):
         self.debug('total length: %r', 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
         # FIXME: publicize bus and reuse it instead of regetting and adding ?
         bus = self.pipeline.get_bus()
@@ -246,6 +254,12 @@ class EncodeTask(gstreamer.GstPipelineTask):
                 self.log('higher peakdB found, now %r', self._peakdB)
                 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):
         if self._peakdB is not None:
             self.debug('peakdB %r', self._peakdB)

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list