From 6b2db2d1036a57d017532d613d7f99e84968e0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Thu, 22 Nov 2012 15:32:21 -0500 Subject: [PATCH 1/5] macosx: update client --- client/Mac/MRDPView.h | 3 ++- client/Mac/MRDPView.m | 29 ++++++++++++++++++++++------ libfreerdp/codec/CMakeLists.txt | 2 ++ libfreerdp/codec/mppc_enc.c | 2 +- libfreerdp/core/CMakeLists.txt | 2 +- libfreerdp/core/rpc.c | 8 ++++++++ libfreerdp/crypto/CMakeLists.txt | 2 +- libfreerdp/locale/keyboard_xkbfile.c | 3 ++- libfreerdp/utils/CMakeLists.txt | 7 +------ winpr/libwinpr/file/file.c | 2 +- 10 files changed, 42 insertions(+), 18 deletions(-) diff --git a/client/Mac/MRDPView.h b/client/Mac/MRDPView.h index 433ff644d..d01a27d81 100644 --- a/client/Mac/MRDPView.h +++ b/client/Mac/MRDPView.h @@ -16,7 +16,8 @@ #import "freerdp/graphics.h" #import "freerdp/utils/event.h" #import "freerdp/client/cliprdr.h" -#import "freerdp/utils/args.h" +#import "freerdp/client/file.h" +#import "freerdp/client/cmdline.h" #import "freerdp/rail/rail.h" #import "freerdp/rail.h" #import "freerdp/utils/rail.h" diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index 0d65d5326..3da757a03 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -1016,6 +1016,7 @@ int rdp_connect() BOOL mac_pre_connect(freerdp *inst) { + int status; char *cptr; int len; int i; @@ -1213,12 +1214,28 @@ BOOL mac_pre_connect(freerdp *inst) } } #endif - - freerdp_parse_args(inst->settings, g_mrdpview->argc, g_mrdpview->argv, process_plugin_args, inst->context->channels, NULL, NULL); - if ((strcmp(g_mrdpview->argv[1], "-h") == 0) || (strcmp(g_mrdpview->argv[1], "--help") == 0)) { - [NSApp terminate:nil]; - return TRUE; - } + + if (freerdp_detect_old_command_line_syntax(inst->context->argc, inst->context->argv)) + { + printf("warning: deprecated command-line syntax detected!\n"); + freerdp_client_print_command_line_help(inst->context->argc, inst->context->argv); + + [NSApp terminate:nil]; + return TRUE; + } + + inst->context->argc = g_mrdpview->argc; + inst->context->argv = g_mrdpview->argv; + + status = freerdp_client_parse_command_line_arguments(inst->context->argc, inst->context->argv, inst->settings); + + if (status < 0) + { + [NSApp terminate:nil]; + return TRUE; + } + + freerdp_client_load_addins(inst->context->channels, inst->settings); [g_mrdpview setViewSize:inst->settings->DesktopWidth :inst->settings->DesktopHeight]; diff --git a/libfreerdp/codec/CMakeLists.txt b/libfreerdp/codec/CMakeLists.txt index 6481fa0fd..7901f1792 100644 --- a/libfreerdp/codec/CMakeLists.txt +++ b/libfreerdp/codec/CMakeLists.txt @@ -99,6 +99,8 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MODULE freerdp MODULES freerdp-utils) +message(STATUS "libfreerdp-codec libs: ${${MODULE_PREFIX}_LIBS}") + if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) else() diff --git a/libfreerdp/codec/mppc_enc.c b/libfreerdp/codec/mppc_enc.c index 07f3d421e..d732f0941 100644 --- a/libfreerdp/codec/mppc_enc.c +++ b/libfreerdp/codec/mppc_enc.c @@ -772,7 +772,7 @@ BOOL compress_rdp_5(struct rdp_mppc_enc* enc, BYTE* srcData, int len) /* encode copy_offset and insert into output buffer */ - if ((copy_offset >= 0) && (copy_offset <= 63)) + if (copy_offset <= 63) /* (copy_offset >= 0) is always true */ { /* insert binary header */ data = 0x1f; diff --git a/libfreerdp/core/CMakeLists.txt b/libfreerdp/core/CMakeLists.txt index 5b88112ac..efd309109 100644 --- a/libfreerdp/core/CMakeLists.txt +++ b/libfreerdp/core/CMakeLists.txt @@ -113,7 +113,7 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${OPENSSL_LIBRARIES}) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL MODULE freerdp - MODULES freerdp-core freerdp-crypto freerdp-codec freerdp-locale freerdp-utils) + MODULES freerdp-crypto freerdp-codec freerdp-locale freerdp-utils) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} diff --git a/libfreerdp/core/rpc.c b/libfreerdp/core/rpc.c index 8c192c35c..c9eda2b44 100644 --- a/libfreerdp/core/rpc.c +++ b/libfreerdp/core/rpc.c @@ -809,6 +809,12 @@ int rpc_in_write(rdpRpc* rpc, BYTE* data, int length) { int status; +#ifdef WITH_DEBUG_TSG + rpc_pdu_header_print((rpcconn_hdr_t*) data); + printf("Sending PDU (length: %d)\n", length); + freerdp_hexdump(data, length); +#endif + status = tls_write_all(rpc->TlsIn, data, length); return status; @@ -871,6 +877,8 @@ int rpc_recv_pdu(rdpRpc* rpc) header = (rpcconn_hdr_t*) rpc->buffer; bytesRead += status; + rpc_pdu_header_print(header); + if (header->common.frag_length > rpc->length) { rpc->length = header->common.frag_length; diff --git a/libfreerdp/crypto/CMakeLists.txt b/libfreerdp/crypto/CMakeLists.txt index 6ff7cc386..0ee373880 100644 --- a/libfreerdp/crypto/CMakeLists.txt +++ b/libfreerdp/crypto/CMakeLists.txt @@ -59,7 +59,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} MODULE winpr - MODULES winpr-crt) + MODULES winpr-crt winpr-library) if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/libfreerdp/locale/keyboard_xkbfile.c b/libfreerdp/locale/keyboard_xkbfile.c index 40cb40481..1b15be6ea 100644 --- a/libfreerdp/locale/keyboard_xkbfile.c +++ b/libfreerdp/locale/keyboard_xkbfile.c @@ -183,7 +183,8 @@ void* freerdp_keyboard_xkb_init() UINT32 freerdp_keyboard_init_xkbfile(UINT32 keyboardLayoutId, RDP_SCANCODE x11_keycode_to_rdp_scancode[256]) { void* display; - memset(x11_keycode_to_rdp_scancode, 0, sizeof(x11_keycode_to_rdp_scancode)); + + ZeroMemory(x11_keycode_to_rdp_scancode, sizeof(RDP_SCANCODE) * 256); display = freerdp_keyboard_xkb_init(); diff --git a/libfreerdp/utils/CMakeLists.txt b/libfreerdp/utils/CMakeLists.txt index 0d871e73a..63d10d5cc 100644 --- a/libfreerdp/utils/CMakeLists.txt +++ b/libfreerdp/utils/CMakeLists.txt @@ -65,15 +65,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES SunOS) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt) endif() -set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS - MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL - MODULE freerdp - MODULES freerdp-common) - set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} MODULE winpr - MODULES winpr-crt winpr-synch) + MODULES winpr-crt winpr-synch winpr-thread) if(MONOLITHIC_BUILD) set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE) diff --git a/winpr/libwinpr/file/file.c b/winpr/libwinpr/file/file.c index b1b089c2b..00e5dc600 100644 --- a/winpr/libwinpr/file/file.c +++ b/winpr/libwinpr/file/file.c @@ -300,7 +300,7 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) struct stat fileStat; WIN32_FILE_SEARCH* pFileSearch; - ZeroMemory(lpFindFileData, sizeof(LPWIN32_FIND_DATAA)); + ZeroMemory(lpFindFileData, sizeof(WIN32_FIND_DATAA)); pFileSearch = (WIN32_FILE_SEARCH*) malloc(sizeof(WIN32_FILE_SEARCH)); ZeroMemory(pFileSearch, sizeof(WIN32_FILE_SEARCH)); From 9af3c21959711d9d0348db5135c8515efcefccf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sun, 25 Nov 2012 15:35:58 -0500 Subject: [PATCH 2/5] xfreerdp-server: fix build --- server/X11/CMakeLists.txt | 3 ++- winpr/libwinpr/rpc/rpc.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/X11/CMakeLists.txt b/server/X11/CMakeLists.txt index 74a1a4c47..dd24a2976 100644 --- a/server/X11/CMakeLists.txt +++ b/server/X11/CMakeLists.txt @@ -90,7 +90,7 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${X11_LIBRARIES}) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} MODULE freerdp - MODULES freerdp-core freerdp-codec freerdp-utils freerdp-gdi freerdp-crypto freerdp-locale) + MODULES freerdp-core freerdp-common freerdp-codec freerdp-utils freerdp-gdi freerdp-crypto freerdp-locale) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} @@ -101,3 +101,4 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/X11") + diff --git a/winpr/libwinpr/rpc/rpc.c b/winpr/libwinpr/rpc/rpc.c index 07dcd3ed8..13d9862c8 100644 --- a/winpr/libwinpr/rpc/rpc.c +++ b/winpr/libwinpr/rpc/rpc.c @@ -582,7 +582,7 @@ RPC_STATUS UuidToStringA(UUID* Uuid, RPC_CSTR* StringUuid) * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */ - sprintf_s((char*) *StringUuid, 36 + 1, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + sprintf_s((char*) *StringUuid, 36 + 1, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", Uuid->Data1, Uuid->Data2, Uuid->Data3, Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], Uuid->Data4[3], Uuid->Data4[4], From c8bfed8d31ea00939e5dfb48c8927459a9e42146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Mon, 26 Nov 2012 01:15:11 -0500 Subject: [PATCH 3/5] channels: fix connection flags for rdpsnd --- channels/rdpsnd/client/rdpsnd_main.c | 24 ++++++++++++++++++++++++ client/common/cmdline.c | 3 +++ 2 files changed, 27 insertions(+) diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index f06a4785f..451fc5023 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -319,20 +319,27 @@ static void rdpsnd_process_message_wave_info(rdpsndPlugin* rdpsnd, STREAM* data_ DEBUG_SVC("waveDataSize %d wFormatNo %d", rdpsnd->waveDataSize, wFormatNo); rdpsnd->close_timestamp = 0; + if (!rdpsnd->is_open) { rdpsnd->current_format = wFormatNo; rdpsnd->is_open = TRUE; + if (rdpsnd->device) + { IFCALL(rdpsnd->device->Open, rdpsnd->device, &rdpsnd->supported_formats[wFormatNo], rdpsnd->latency); + } } else if (wFormatNo != rdpsnd->current_format) { rdpsnd->current_format = wFormatNo; + if (rdpsnd->device) + { IFCALL(rdpsnd->device->SetFormat, rdpsnd->device, &rdpsnd->supported_formats[wFormatNo], rdpsnd->latency); + } } } @@ -345,14 +352,19 @@ static void rdpsnd_process_message_wave(rdpsndPlugin* rdpsnd, STREAM* data_in) struct data_out_item* item; rdpsnd->expectingWave = 0; + memcpy(stream_get_head(data_in), rdpsnd->waveData, 4); + if (stream_get_size(data_in) != rdpsnd->waveDataSize) { DEBUG_WARN("size error"); return; } + if (rdpsnd->device) + { IFCALL(rdpsnd->device->Play, rdpsnd->device, stream_get_head(data_in), stream_get_size(data_in)); + } process_ms = get_mstime() - rdpsnd->wave_timestamp; delay_ms = 250; @@ -380,8 +392,12 @@ static void rdpsnd_process_message_wave(rdpsndPlugin* rdpsnd, STREAM* data_in) static void rdpsnd_process_message_close(rdpsndPlugin* rdpsnd) { DEBUG_SVC("server closes."); + if (rdpsnd->device) + { IFCALL(rdpsnd->device->Start, rdpsnd->device); + } + rdpsnd->close_timestamp = get_mstime() + 2000; rdpsnd->plugin.interval_ms = 10; } @@ -392,8 +408,11 @@ static void rdpsnd_process_message_setvolume(rdpsndPlugin* rdpsnd, STREAM* data_ stream_read_UINT32(data_in, dwVolume); DEBUG_SVC("dwVolume 0x%X", dwVolume); + if (rdpsnd->device) + { IFCALL(rdpsnd->device->SetVolume, rdpsnd->device, dwVolume); + } } static void rdpsnd_process_receive(rdpSvcPlugin* plugin, STREAM* data_in) @@ -420,18 +439,23 @@ static void rdpsnd_process_receive(rdpSvcPlugin* plugin, STREAM* data_in) case SNDC_FORMATS: rdpsnd_process_message_formats(rdpsnd, data_in); break; + case SNDC_TRAINING: rdpsnd_process_message_training(rdpsnd, data_in); break; + case SNDC_WAVE: rdpsnd_process_message_wave_info(rdpsnd, data_in, BodySize); break; + case SNDC_CLOSE: rdpsnd_process_message_close(rdpsnd); break; + case SNDC_SETVOLUME: rdpsnd_process_message_setvolume(rdpsnd, data_in); break; + default: DEBUG_WARN("unknown msgType %d", msgType); break; diff --git a/client/common/cmdline.c b/client/common/cmdline.c index df5c7bc48..6ea3879fc 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -883,6 +883,9 @@ int freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) int index; ADDIN_ARGV* args; + if (freerdp_static_channel_collection_find(settings, "rdpsnd")) + settings->AudioPlayback = TRUE; + if (settings->DeviceRedirection) { freerdp_client_load_static_channel_addin(channels, settings, "rdpdr", settings); From ab1cf1cb02cd1ad99320906ab45192f686921cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Mon, 26 Nov 2012 01:23:23 -0500 Subject: [PATCH 4/5] channels/rdpsnd: fix default device name with alsa --- channels/rdpsnd/client/alsa/rdpsnd_alsa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c index 679826ad5..05a8dea6d 100644 --- a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c +++ b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c @@ -477,6 +477,9 @@ int freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pE args = pEntryPoints->args; rdpsnd_alsa_parse_addin_args((rdpsndDevicePlugin*) alsa, args); + if (!alsa->device_name) + alsa->device_name = _strdup("default"); + alsa->out_handle = 0; alsa->source_rate = 22050; alsa->actual_rate = 22050; From bb54216cbb87b70ad8c2d094a7ee50e2120fcd37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Mon, 26 Nov 2012 01:34:40 -0500 Subject: [PATCH 5/5] channels/tsmf: fix connection settings for tsmf --- channels/tsmf/client/alsa/tsmf_alsa.c | 35 ++++++++++++++++++--------- client/common/cmdline.c | 7 ++++-- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/channels/tsmf/client/alsa/tsmf_alsa.c b/channels/tsmf/client/alsa/tsmf_alsa.c index a3c3a938a..393f62ea8 100644 --- a/channels/tsmf/client/alsa/tsmf_alsa.c +++ b/channels/tsmf/client/alsa/tsmf_alsa.c @@ -49,13 +49,14 @@ typedef struct _TSMFALSAAudioDevice UINT32 bytes_per_sample; FREERDP_DSP_CONTEXT* dsp_context; -} TSMFALSAAudioDevice; +} TSMFAlsaAudioDevice; -static BOOL tsmf_alsa_open_device(TSMFALSAAudioDevice* alsa) +static BOOL tsmf_alsa_open_device(TSMFAlsaAudioDevice* alsa) { int error; error = snd_pcm_open(&alsa->out_handle, alsa->device, SND_PCM_STREAM_PLAYBACK, 0); + if (error < 0) { DEBUG_WARN("failed to open device %s", alsa->device); @@ -68,7 +69,7 @@ static BOOL tsmf_alsa_open_device(TSMFALSAAudioDevice* alsa) static BOOL tsmf_alsa_open(ITSMFAudioDevice* audio, const char* device) { - TSMFALSAAudioDevice* alsa = (TSMFALSAAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; if (!device) { @@ -90,7 +91,7 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, snd_pcm_uframes_t frames; snd_pcm_hw_params_t* hw_params; snd_pcm_sw_params_t* sw_params; - TSMFALSAAudioDevice* alsa = (TSMFALSAAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; if (!alsa->out_handle) return FALSE; @@ -102,11 +103,13 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, alsa->bytes_per_sample = bits_per_sample / 8; error = snd_pcm_hw_params_malloc(&hw_params); + if (error < 0) { DEBUG_WARN("snd_pcm_hw_params_malloc failed"); return FALSE; } + snd_pcm_hw_params_any(alsa->out_handle, hw_params); snd_pcm_hw_params_set_access(alsa->out_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); @@ -123,11 +126,13 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, snd_pcm_hw_params_free(hw_params); error = snd_pcm_sw_params_malloc(&sw_params); + if (error < 0) { DEBUG_WARN("snd_pcm_sw_params_malloc"); return FALSE; } + snd_pcm_sw_params_current(alsa->out_handle, sw_params); snd_pcm_sw_params_set_start_threshold(alsa->out_handle, sw_params, frames / 2); @@ -139,6 +144,7 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, DEBUG_DVC("sample_rate %d channels %d bits_per_sample %d", sample_rate, channels, bits_per_sample); DEBUG_DVC("hardware buffer %d frames", (int)frames); + if ((alsa->actual_rate != alsa->source_rate) || (alsa->actual_channels != alsa->source_channels)) { @@ -147,6 +153,7 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio, alsa->actual_rate, alsa->actual_channels, alsa->source_rate, alsa->source_channels); } + return TRUE; } @@ -160,7 +167,7 @@ static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, BYTE* data, UINT32 data_size BYTE* pindex; int rbytes_per_frame; int sbytes_per_frame; - TSMFALSAAudioDevice* alsa = (TSMFALSAAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; DEBUG_DVC("data_size %d", data_size); @@ -193,6 +200,7 @@ static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, BYTE* data, UINT32 data_size len = end - pindex; frames = len / rbytes_per_frame; error = snd_pcm_writei(alsa->out_handle, pindex, frames); + if (error == -EPIPE) { snd_pcm_recover(alsa->out_handle, error, 0); @@ -206,9 +214,12 @@ static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, BYTE* data, UINT32 data_size tsmf_alsa_open_device(alsa); break; } + DEBUG_DVC("%d frames played.", error); + if (error == 0) break; + pindex += error * rbytes_per_frame; } } @@ -221,14 +232,15 @@ static UINT64 tsmf_alsa_get_latency(ITSMFAudioDevice* audio) { UINT64 latency = 0; snd_pcm_sframes_t frames = 0; - TSMFALSAAudioDevice* alsa = (TSMFALSAAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; if (alsa->out_handle && alsa->actual_rate > 0 && snd_pcm_delay(alsa->out_handle, &frames) == 0 && frames > 0) { - latency = ((UINT64)frames) * 10000000LL / (UINT64)alsa->actual_rate; + latency = ((UINT64)frames) * 10000000LL / (UINT64) alsa->actual_rate; } + return latency; } @@ -238,7 +250,7 @@ static void tsmf_alsa_flush(ITSMFAudioDevice* audio) static void tsmf_alsa_free(ITSMFAudioDevice* audio) { - TSMFALSAAudioDevice* alsa = (TSMFALSAAudioDevice*) audio; + TSMFAlsaAudioDevice* alsa = (TSMFAlsaAudioDevice*) audio; DEBUG_DVC(""); @@ -247,6 +259,7 @@ static void tsmf_alsa_free(ITSMFAudioDevice* audio) snd_pcm_drain(alsa->out_handle); snd_pcm_close(alsa->out_handle); } + freerdp_dsp_context_free(alsa->dsp_context); free(alsa); } @@ -257,10 +270,10 @@ static void tsmf_alsa_free(ITSMFAudioDevice* audio) ITSMFAudioDevice* freerdp_tsmf_client_audio_subsystem_entry(void) { - TSMFALSAAudioDevice* alsa; + TSMFAlsaAudioDevice* alsa; - alsa = (TSMFALSAAudioDevice*) malloc(sizeof(TSMFALSAAudioDevice)); - ZeroMemory(alsa, sizeof(TSMFALSAAudioDevice)); + alsa = (TSMFAlsaAudioDevice*) malloc(sizeof(TSMFAlsaAudioDevice)); + ZeroMemory(alsa, sizeof(TSMFAlsaAudioDevice)); alsa->iface.Open = tsmf_alsa_open; alsa->iface.SetFormat = tsmf_alsa_set_format; diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 6ea3879fc..83afc4679 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -883,8 +883,11 @@ int freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) int index; ADDIN_ARGV* args; - if (freerdp_static_channel_collection_find(settings, "rdpsnd")) - settings->AudioPlayback = TRUE; + if ((freerdp_static_channel_collection_find(settings, "rdpsnd")) || + (freerdp_dynamic_channel_collection_find(settings, "tsmf"))) + { + settings->AudioPlayback = TRUE; /* Both rdpsnd and tsmf require this flag to be set */ + } if (settings->DeviceRedirection) {