[banshee] GStreamerSharp: prefer an InvalidOperationException than a NRE



commit 87c3e217c482f9dee289c54a23a5d711cb56e4b5
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Sat Oct 12 18:49:02 2013 +0200

    GStreamerSharp: prefer an InvalidOperationException than a NRE
    
    If retrieving the tee pad doesn't work, it's better to throw an
    InvalidOperationException right away, instead of causing a NRE
    at a later stage.

 .../Banshee.GStreamerSharp/PlayerEngine.cs         |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
index fb117ca..a84884b 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
@@ -299,7 +299,11 @@ namespace Banshee.GStreamerSharp
 
             public Pad RequestTeePad ()
             {
-                return audiotee.GetRequestPad ("src%d");
+                var pad = audiotee.GetRequestPad ("src_%d");
+                if (pad == null) {
+                    throw new InvalidOperationException ("Could not retrieve tee pad");
+                }
+                return pad;
             }
         }
 


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