[pitivi] project: Sample rate are integers, cast them



commit 9c153b383e6bdc047f4736a7b92cd3179f049e5a
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Fri Aug 30 21:08:20 2013 -0400

    project: Sample rate are integers, cast them
    
    https://github.com/pitivi/pitivi/issues/97

 pitivi/project.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/project.py b/pitivi/project.py
index 25367b7..3d71ff1 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -677,12 +677,16 @@ class Project(Loggable, GES.Project):
 
     @property
     def audiorate(self):
-        return self.audio_profile.get_restriction()[0]["rate"]
+        try:
+            return int(self.audio_profile.get_restriction()[0]["rate"])
+        except TypeError:
+            return None
 
     @audiorate.setter
     def audiorate(self, value):
-        if self.audio_profile.get_restriction()[0]["rate"] != value and value:
-            self.audio_profile.get_restriction()[0]["rate"] = value
+        if self.audio_profile.get_restriction()[0]["rate"] != value and \
+                value is not None:
+            self.audio_profile.get_restriction()[0]["rate"] = int(value)
             self._emitChange("rendering-settings-changed", "rate", value)
 
     @property


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