[orca] Sanity check source and sink before adding them to the pipeline



commit ea552547453d87863950b37bf4ea98b420f84628
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Dec 2 09:16:16 2019 -0500

    Sanity check source and sink before adding them to the pipeline

 src/orca/sound.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/orca/sound.py b/src/orca/sound.py
index 4f8cad5e4..7c7cbc73e 100644
--- a/src/orca/sound.py
+++ b/src/orca/sound.py
@@ -119,6 +119,9 @@ class Player:
 
         self._source = Gst.ElementFactory.make('audiotestsrc', 'src')
         self._sink = Gst.ElementFactory.make('autoaudiosink', 'output')
+        if self._source is None or self._sink is None:
+            return
+
         self._pipeline.add(self._source)
         self._pipeline.add(self._sink)
         self._source.link(self._sink)


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