[pitivi] SmartVideoMixerBin: Use safe dict accessor (.get() instead of [])



commit ff68278afde665b5bbea2b39b2fcd683032b2ec2
Author: Edward Hervey <bilboed bilboed com>
Date:   Tue May 18 21:05:08 2010 +0200

    SmartVideoMixerBin: Use safe dict accessor (.get() instead of [])
    
    Should avoid some weird exceptions seen on launchpad but not
    reproducable.

 pitivi/elements/mixer.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/elements/mixer.py b/pitivi/elements/mixer.py
index 65079e3..9971901 100644
--- a/pitivi/elements/mixer.py
+++ b/pitivi/elements/mixer.py
@@ -145,8 +145,9 @@ class SmartVideomixerBin(gst.Bin):
         self.debug("pad:%r, priority:%d" % ( pad, priority))
         if priority > 10000:
             priority = 10000
-        a,b,c,sinkpad = self.inputs[pad.get_name()]
-        sinkpad.props.zorder = 10000 - priority
+        a,b,c,sinkpad = self.inputs.get(pad.get_name(), (None, None, None, None))
+        if sinkpad:
+            sinkpad.props.zorder = 10000 - priority
         self.debug("done")
 
     def do_request_new_pad(self, template, name=None):



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