Index: constants.h =================================================================== --- constants.h (revision 1789) +++ constants.h (working copy) @@ -442,6 +442,9 @@ #define RD_STATUS_CANCELLED 0xc0000120 #define RD_STATUS_DIRECTORY_NOT_EMPTY 0xc0000101 +/* RDPSND constants */ +#define TSSNDCAPS_ALIVE 0x00000001 +#define TSSNDCAPS_VOLUME 0x00000002 /* RDPDR constants */ #define RDPDR_MAX_DEVICES 0x10 Index: rdesktop.c =================================================================== --- rdesktop.c (revision 1789) +++ rdesktop.c (working copy) @@ -1098,11 +1098,8 @@ return EX_OSERR; #ifdef WITH_RDPSND - if (g_rdpsnd) - { - if (!rdpsnd_init(rdpsnd_optarg)) - warning("Initializing sound-support failed!\n"); - } + if (!rdpsnd_init(rdpsnd_optarg)) + warning("Initializing sound-support failed!\n"); #endif if (g_lspci_enabled) 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; @@ -255,7 +257,7 @@ rdpsnd_reset_state(); } - if (!current_driver) + if (!current_driver && g_rdpsnd) device_available = rdpsnd_auto_select(); if (current_driver && !device_available && current_driver->wave_out_open()) @@ -301,7 +303,13 @@ } out = rdpsnd_init_packet(RDPSND_NEGOTIATE | 0x200, 20 + 18 * format_count); - out_uint32_le(out, 0x00800003); /* flags */ + + /* if g_rdpsnd, enable the sound device */ + uint32 flags = TSSNDCAPS_VOLUME; + if (g_rdpsnd) + flags |= TSSNDCAPS_ALIVE; + + out_uint32_le(out, flags); /* TSSNDCAPS flags */ out_uint32(out, 0xffffffff); /* volume */ out_uint32(out, 0); /* pitch */ out_uint16(out, 0); /* UDP port */ Index: xwin.c =================================================================== --- xwin.c (revision 1789) +++ xwin.c (working copy) @@ -2209,6 +2209,7 @@ XCopyArea(g_display, contents, g_wnd, g_gc, 0, 0, g_width, g_height, 0, 0); XFreePixmap(g_display, contents); } + g_pending_resize=1; } static void