[Spice-devel,v6,16/18] sound: Use default message handler if possible

Submitted by Frediano Ziglio on Dec. 2, 2016, 10:54 a.m.

Details

Message ID 76b13b18301a09a664e7485a7b42816f0a5c6220.1480676032.git-series.fziglio@redhat.com
State Accepted
Commit cd82c9f698fda8992e727647a136785dda898aa5
Headers show
Series "Remove DummyChannel* objects" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Dec. 2, 2016, 10:54 a.m.
red_channel_client_handle_message can handle base messages
so reuse it.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/sound.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/sound.c b/server/sound.c
index ed20125..04e08a2 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -322,18 +322,6 @@  static int snd_record_handle_write(RecordChannelClient *record_client, size_t si
 }
 
 static int
-playback_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint16_t type, void *message)
-{
-    switch (type) {
-    case SPICE_MSGC_DISCONNECTING:
-        break;
-    default:
-        return red_channel_client_handle_message(rcc, size, type, message);
-    }
-    return TRUE;
-}
-
-static int
 record_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint16_t type, void *message)
 {
     RecordChannelClient *record_client = RECORD_CHANNEL_CLIENT(rcc);
@@ -370,8 +358,6 @@  record_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint16_t type
         record_client->start_time = mark->time;
         break;
     }
-    case SPICE_MSGC_DISCONNECTING:
-        break;
     default:
         return red_channel_client_handle_message(rcc, size, type, message);
     }
@@ -1423,7 +1409,7 @@  playback_channel_class_init(PlaybackChannelClass *klass)
     object_class->constructed = playback_channel_constructed;
 
     channel_class->parser = spice_get_client_channel_parser(SPICE_CHANNEL_PLAYBACK, NULL);
-    channel_class->handle_parsed = playback_channel_handle_parsed;
+    channel_class->handle_parsed = red_channel_client_handle_message;
     channel_class->send_item = playback_channel_send_item;
 }