summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciana Fujii Pontello <luciana@fujii.eti.br>2010-09-29 21:03:10 (GMT)
committerLuciana Fujii Pontello <luciana@fujii.eti.br>2010-09-29 21:03:10 (GMT)
commit621676fb3a1cef796e70e13a0e83200dfe9baf7c (patch)
tree5c7253bc1883be257105194843619362002034ec
parent1ff64e0d2cfe89cc1671fba865577ed4c1cc8f99 (diff)
downloadsltv-621676fb3a1cef796e70e13a0e83200dfe9baf7c.tar.gz
sltv-621676fb3a1cef796e70e13a0e83200dfe9baf7c.tar.xz
sltv: Checking if audio source is selected
If we have audio sources added, one needs to be selected. If one is not selected an error is displayed and the pipeline won't go to playing.
-rw-r--r--sltv/sltv.py8
-rw-r--r--sltv/ui/core.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/sltv/sltv.py b/sltv/sltv.py
index d5c6c4e..708f6fd 100644
--- a/sltv/sltv.py
+++ b/sltv/sltv.py
@@ -238,6 +238,14 @@ class Sltv(gobject.GObject):
if element.does_audio():
if not self.input_type & MEDIA_AUDIO:
+
+ # The pipeline has audio sources, and this is the first
+ # audio source we add
+
+ if self.audio_source is None:
+ self.emit("error", "You need to select an audio source")
+ self.emit("stopped")
+ return
self.input_type |= MEDIA_AUDIO
self.input_selector = gst.element_factory_make(
"input-selector", "audio-selector"
diff --git a/sltv/ui/core.py b/sltv/ui/core.py
index a9ee91e..3b55475 100644
--- a/sltv/ui/core.py
+++ b/sltv/ui/core.py
@@ -198,7 +198,7 @@ class SltvUI:
def selected_audio_source(self):
model = self.audio_sources_combobox.get_model()
iter = self.audio_sources_combobox.get_active_iter()
- if iter == None:
+ if iter is None:
return None
return model.get_value(iter, 0)