[Spice-devel] [PATCH spice-gtk v2 5/5] record channel: reseting channel caps

Yonit Halperin yhalperi at redhat.com
Thu May 17 05:25:38 PDT 2012


---
 gtk/channel-record.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/gtk/channel-record.c b/gtk/channel-record.c
index d93d908..0ae9e4c 100644
--- a/gtk/channel-record.c
+++ b/gtk/channel-record.c
@@ -89,15 +89,20 @@ static void channel_up(SpiceChannel *channel);
 
 /* ------------------------------------------------------------------ */
 
-static void spice_record_channel_init(SpiceRecordChannel *channel)
+static void spice_record_channel_reset_capabilities(SpiceChannel *channel)
 {
-    channel->priv = SPICE_RECORD_CHANNEL_GET_PRIVATE(channel);
-
     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);
 }
 
+static void spice_record_channel_init(SpiceRecordChannel *channel)
+{
+    channel->priv = SPICE_RECORD_CHANNEL_GET_PRIVATE(channel);
+
+    spice_record_channel_reset_capabilities(SPICE_CHANNEL(channel));
+}
+
 static void spice_record_channel_finalize(GObject *obj)
 {
     SpiceRecordChannelPrivate *c = SPICE_RECORD_CHANNEL(obj)->priv;
@@ -195,6 +200,7 @@ static void spice_record_channel_class_init(SpiceRecordChannelClass *klass)
     channel_class->handle_msg   = spice_record_handle_msg;
     channel_class->channel_up   = channel_up;
     channel_class->channel_reset = channel_reset;
+    channel_class->channel_reset_capabilities = spice_record_channel_reset_capabilities;
 
     g_object_class_install_property
         (gobject_class, PROP_NCHANNELS,
-- 
1.7.7.6



More information about the Spice-devel mailing list