[rygel] Take user transcoding configuration into account



commit 747db1c781af3368f1536d088fb9028c89e7f6ab
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu May 28 16:39:03 2009 +0300

    Take user transcoding configuration into account
---
 src/rygel/rygel-transcode-manager.vala |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/rygel/rygel-transcode-manager.vala b/src/rygel/rygel-transcode-manager.vala
index a4a982c..b53d7d6 100644
--- a/src/rygel/rygel-transcode-manager.vala
+++ b/src/rygel/rygel-transcode-manager.vala
@@ -37,10 +37,20 @@ internal abstract class Rygel.TranscodeManager : GLib.Object {
     public TranscodeManager () {
         transcoders = new ArrayList<Transcoder> ();
 
-        transcoders.add (new L16Transcoder (Endianness.BIG));
-        transcoders.add (new MP3Transcoder (MP3Layer.THREE));
-        transcoders.add (new MP2TSTranscoder(MP2TSProfile.SD));
-        transcoders.add (new MP2TSTranscoder(MP2TSProfile.HD));
+        var config = Configuration.get_default ();
+
+        if (config.transcoding) {
+            if (config.lpcm_transcoder) {
+                transcoders.add (new L16Transcoder (Endianness.BIG));
+            }
+            if (config.mp3_transcoder) {
+                transcoders.add (new MP3Transcoder (MP3Layer.THREE));
+            }
+            if (config.mp2ts_transcoder) {
+                transcoders.add (new MP2TSTranscoder(MP2TSProfile.SD));
+                transcoders.add (new MP2TSTranscoder(MP2TSProfile.HD));
+            }
+        }
     }
 
     public abstract string create_uri_for_item (MediaItem  item,



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