Index: channels.c =================================================================== --- channels.c (revision 1789) +++ channels.c (working copy) @@ -153,6 +153,7 @@ if (i >= g_num_channels) return; + in_uint32_le(s, length); in_uint32_le(s, flags); if ((flags & CHANNEL_FLAG_FIRST) && (flags & CHANNEL_FLAG_LAST)) Index: rdesktop.c =================================================================== --- rdesktop.c (revision 1789) +++ rdesktop.c (working copy) @@ -1097,6 +1097,7 @@ if (!ui_init()) return EX_OSERR; + rdpsnd_preinit(); #ifdef WITH_RDPSND if (g_rdpsnd) { Index: rdpsnd.c =================================================================== --- rdpsnd.c (revision 1789) +++ rdpsnd.c (working copy) @@ -45,6 +45,8 @@ #define MAX_FORMATS 10 #define MAX_QUEUE 50 +extern RD_BOOL g_rdpsnd; + static VCHANNEL *rdpsnd_channel; static VCHANNEL *rdpsnddbg_channel; static struct audio_driver *drivers = NULL; @@ -580,6 +582,9 @@ { uint16 len; + if (!g_rdpsnd) + return; + while (!s_check_end(s)) { /* New packet */ @@ -696,6 +701,15 @@ } RD_BOOL +rdpsnd_preinit() +{ + rdpsnd_channel = + channel_register("rdpsnd", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP, + rdpsnd_process); + return (rdpsnd_channel != NULL); +} + +RD_BOOL rdpsnd_init(char *optarg) { struct audio_driver *pos; @@ -707,10 +721,6 @@ packet.p = packet.end = packet.data; packet.size = 0; - rdpsnd_channel = - channel_register("rdpsnd", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP, - rdpsnd_process); - rdpsnddbg_channel = channel_register("snddbg", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP, rdpsnddbg_process);