[pitivi] render: Work around PyGObject refcount issue with caps.fixate()



commit bd3e5072c609064a614f113e1124f9020b2db662
Author: Thibault Saunier <tsaunier gnome org>
Date:   Sat Jul 15 00:40:37 2017 -0400

    render: Work around PyGObject refcount issue with caps.fixate()
    
    Incrementing the caps refcount as PyGObject should do will avoid
    a critical issue (which leads to segfault in current master but
    it is another issue).
    
    Reviewed-by: Alex Băluț <<alexandru balut gmail com>>
    Differential Revision: https://phabricator.freedesktop.org/D1779

 pitivi/render.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/render.py b/pitivi/render.py
index ecc7546..ad62870 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -985,6 +985,10 @@ class RenderDialog(Loggable):
             for struct in factory.get_static_pad_templates():
                 if struct.direction == Gst.PadDirection.SINK:
                     caps = Gst.Caps.from_string(struct.get_caps().to_string())
+                    # FIXME HACK! - remove once https://bugzilla.gnome.org/show_bug.cgi?id=784960
+                    # is fixed.
+                    caps.mini_object.refcount += 1
+
                     fixed = caps.fixate()
                     fmt = fixed.get_structure(0).get_value("format")
                     self.project.setVideoRestriction("format", fmt)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]