[Spice-devel] [PATCH spice-gtk] Allow to disable CELT at runtime
Alon Levy
alevy at redhat.com
Wed Apr 18 22:31:06 PDT 2012
On Wed, Apr 18, 2012 at 07:04:35PM +0200, Marc-André Lureau wrote:
> We might want to make it a property, but having an environemnt variable
> is useful too, to override behaviour.
Do we want to start documenting those environment variables at some
point? Just a thought.
ACK.
> ---
> 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
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list