[pitivi: 1/2] Add a workaround for a bug in identity with single
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi: 1/2] Add a workaround for a bug in identity with single
- Date: Fri, 6 Mar 2009 12:02:54 -0500 (EST)
commit 1cc681da25ff5491ca0d5622ab66fb5846e77601
Author: Alessandro Decina <alessandro decina collabora co uk>
Date: Fri Mar 6 13:13:25 2009 +0100
Add a workaround for a bug in identity with single-segment=true and oggmux.
The bug was fixed in gstreamer core, commit c20fb4c1.
---
pitivi/encode.py | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/pitivi/encode.py b/pitivi/encode.py
index 24434b5..b917cd3 100644
--- a/pitivi/encode.py
+++ b/pitivi/encode.py
@@ -23,6 +23,7 @@
Encoding-related utilities and classes
"""
+import gobject
import gst
import pitivi.log.log as log
from pitivi.factories.base import OperationFactory, SinkFactory
@@ -133,6 +134,13 @@ class RenderFactory(OperationFactory):
raise Exception("can't find a compatible pad")
# FIXME : We're assuming it's a request pad
p2 = mux.get_request_pad(n2)
+
+ if gst.version() < (0, 10, 22, 1):
+ segment_eater = NewsegmentEater()
+ b.add(segment_eater)
+ segment_eater.get_pad('src').link(p2)
+ p2 = segment_eater.get_pad('sink')
+
src2.link(p2)
# expose encoder sink pad
@@ -194,6 +202,36 @@ class RenderSinkFactory(SinkFactory):
b.factory.releaseBin(b)
+class NewsegmentEater(gst.BaseTransform):
+ __gstdetails__ = (
+ "Description",
+ "Klass",
+ "Description",
+ "Author")
+
+ sink_template = gst.PadTemplate("sink",
+ gst.PAD_SINK, gst.PAD_ALWAYS,
+ gst.Caps('ANY'))
+ src_template = gst.PadTemplate("src",
+ gst.PAD_SRC, gst.PAD_ALWAYS,
+ gst.Caps('ANY'))
+
+ __gsttemplates__ = (sink_template, src_template)
+
+ def __init__(self):
+ gst.BaseTransform.__init__(self)
+
+ def do_event(self, event):
+ res = gst.BaseTransform.do_event(self, event)
+ if event.type == gst.EVENT_NEWSEGMENT:
+ # don't forward the event downstream
+ return False
+
+ return res
+
+gobject.type_register(NewsegmentEater)
+
+
def get_compatible_sink_pad(factoryname, caps):
"""
Returns the pad name of a (request) pad from factoryname which is
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]