engine-gst: Print warning on missing profile
authorJens Georg <jensg@openismus.com>
Tue, 18 Dec 2012 21:15:57 +0000 (22:15 +0100)
committerJens Georg <jensg@openismus.com>
Tue, 18 Dec 2012 21:22:22 +0000 (22:22 +0100)
src/media-engines/gstreamer/rygel-gst-transcoder.vala

index b884c72..a201580 100644 (file)
@@ -27,6 +27,10 @@ using Gst;
 using Gst.PbUtils;
 using GUPnP;
 
+public errordomain Rygel.GstTranscoderError {
+    CANT_TRANSCODE
+}
+
 /**
  * The base Transcoder class. Each implementation derives from it and must
  * implement get_distance and get_encoding_profile methods.
@@ -75,6 +79,13 @@ internal abstract class Rygel.GstTranscoder : Rygel.Transcoder {
                                                 ENCODE_BIN);
 
         encoder.profile = this.get_encoding_profile ();
+        if (encoder.profile == null) {
+            var message = _("Could not create a transcoder configuration. " +
+                            "Your GStramer installation might be missing a plug-in");
+
+            throw new GstTranscoderError.CANT_TRANSCODE (message);
+        }
+
         debug ("%s using the following encoding profile:",
                this.get_class ().get_type ().name ());
         GstUtils.dump_encoding_profile (encoder.profile);