[Spice-devel] [PATCH spice-gtk] Allow to disable CELT at runtime

Marc-André Lureau marcandre.lureau at gmail.com
Wed Apr 18 10:04:35 PDT 2012


We might want to make it a property, but having an environemnt variable
is useful too, to override behaviour.
---
 gtk/channel-playback.c |    3 ++-
 gtk/channel-record.c   |    6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/gtk/channel-playback.c b/gtk/channel-playback.c
index 32f8b1a..37b260e 100644
--- a/gtk/channel-playback.c
+++ b/gtk/channel-playback.c
@@ -87,7 +87,8 @@ static void spice_playback_channel_init(SpicePlaybackChannel *channel)
 {
     channel->priv = SPICE_PLAYBACK_CHANNEL_GET_PRIVATE(channel);
 
-    spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_PLAYBACK_CAP_CELT_0_5_1);
+    if (!g_getenv("SPICE_DISABLE_CELT"))
+        spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_PLAYBACK_CAP_CELT_0_5_1);
     spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_PLAYBACK_CAP_VOLUME);
 }
 
diff --git a/gtk/channel-record.c b/gtk/channel-record.c
index fba385b..d93d908 100644
--- a/gtk/channel-record.c
+++ b/gtk/channel-record.c
@@ -93,7 +93,8 @@ static void spice_record_channel_init(SpiceRecordChannel *channel)
 {
     channel->priv = SPICE_RECORD_CHANNEL_GET_PRIVATE(channel);
 
-    spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_RECORD_CAP_CELT_0_5_1);
+    if (!g_getenv("SPICE_DISABLE_CELT"))
+        spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_RECORD_CAP_CELT_0_5_1);
     spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_RECORD_CAP_VOLUME);
 }
 
@@ -317,7 +318,8 @@ static void channel_up(SpiceChannel *channel)
     SpiceRecordChannelPrivate *rc;
 
     rc = SPICE_RECORD_CHANNEL(channel)->priv;
-    if (spice_channel_test_capability(channel, SPICE_RECORD_CAP_CELT_0_5_1)) {
+    if (!g_getenv("SPICE_DISABLE_CELT") &&
+        spice_channel_test_capability(channel, SPICE_RECORD_CAP_CELT_0_5_1)) {
         rc->mode = SPICE_AUDIO_DATA_MODE_CELT_0_5_1;
     } else {
         rc->mode = SPICE_AUDIO_DATA_MODE_RAW;
-- 
1.7.10



More information about the Spice-devel mailing list