From cb8176d2e7ce2a5daf1d757f2dceda9b6d05b2fb Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 7 Mar 2025 09:37:23 +0100 Subject: [PATCH] [channels,rdpsnd] fix warnings, add new fields * Fix warnings in client and server channels * Add some data read from packets to exported fields of RdpsndServerContext --- channels/rdpsnd/client/rdpsnd_main.c | 6 ++++-- channels/rdpsnd/server/rdpsnd_main.c | 6 ++---- include/freerdp/server/rdpsnd.h | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 0ed4aa2be..5be4f179b 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -712,9 +712,11 @@ static UINT rdpsnd_recv_wave2_pdu(rdpsndPlugin* rdpsnd, wStream* s, UINT16 BodyS rdpsnd->waveDataSize = BodySize - 12; rdpsnd->wArrivalTime = GetTickCount64(); WLog_Print(rdpsnd->log, WLOG_DEBUG, - "%s Wave2PDU: cBlockNo: %" PRIu8 " wFormatNo: %" PRIu16 " [%s] , align=%hu", + "%s Wave2PDU: cBlockNo: %" PRIu8 " wFormatNo: %" PRIu16 + " [%s] , align=%hu wTimeStamp=0x%04" PRIx16 ", dwAudioTimeStamp=0x%08" PRIx32, rdpsnd_is_dyn_str(rdpsnd->dynamic), rdpsnd->cBlockNo, wFormatNo, - audio_format_get_tag_string(format->wFormatTag), format->nBlockAlign); + audio_format_get_tag_string(format->wFormatTag), format->nBlockAlign, + rdpsnd->wTimeStamp, dwAudioTimeStamp); if (!rdpsnd_ensure_device_is_open(rdpsnd, wFormatNo, format)) return ERROR_INTERNAL_ERROR; diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index 93091c1e9..7834b39dc 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -185,8 +185,6 @@ static UINT rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, wStrea static UINT rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) { UINT16 num_known_format = 0; - UINT16 udpPort = 0; - BYTE lastblock = 0; UINT error = CHANNEL_RC_OK; WINPR_ASSERT(context); @@ -197,9 +195,9 @@ static UINT rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) Stream_Read_UINT32(s, context->capsFlags); /* dwFlags */ Stream_Read_UINT32(s, context->initialVolume); /* dwVolume */ Stream_Read_UINT32(s, context->initialPitch); /* dwPitch */ - Stream_Read_UINT16(s, udpPort); /* wDGramPort */ + Stream_Read_UINT16(s, context->udpPort); /* wDGramPort */ Stream_Read_UINT16(s, context->num_client_formats); /* wNumberOfFormats */ - Stream_Read_UINT8(s, lastblock); /* cLastBlockConfirmed */ + Stream_Read_UINT8(s, context->lastblock); /* cLastBlockConfirmed */ Stream_Read_UINT16(s, context->clientVersion); /* wVersion */ Stream_Seek_UINT8(s); /* bPad */ diff --git a/include/freerdp/server/rdpsnd.h b/include/freerdp/server/rdpsnd.h index cbd5eab3d..20fd5fd82 100644 --- a/include/freerdp/server/rdpsnd.h +++ b/include/freerdp/server/rdpsnd.h @@ -177,6 +177,9 @@ extern "C" * Only called, when use_dynamic_virtual_channel=TRUE. */ psRdpsndChannelIdAssigned ChannelIdAssigned; + + UINT16 udpPort; /** @since version 3.14.0 */ + UINT8 lastblock; /** @since version 3.14.0 */ }; FREERDP_API void rdpsnd_server_context_free(RdpsndServerContext* context);