[rygel/rygel-0-16] server: Print warning on missing profile



commit 6477a7f4c3c1e5fc42a58315d73b1be8844a6014
Author: Jens Georg <jensg openismus com>
Date:   Tue Dec 18 22:15:57 2012 +0100

    server: Print warning on missing profile

 src/librygel-server/rygel-transcoder.vala |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-server/rygel-transcoder.vala b/src/librygel-server/rygel-transcoder.vala
index 05b3a23..83878bb 100644
--- a/src/librygel-server/rygel-transcoder.vala
+++ b/src/librygel-server/rygel-transcoder.vala
@@ -24,6 +24,10 @@
 using Gst;
 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.
@@ -76,6 +80,13 @@ internal abstract class Rygel.Transcoder : GLib.Object {
                                                 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);



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