diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index 9c09afc89..0af4179e6 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -83,8 +83,8 @@ static BOOL rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s) static BOOL rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, wStream* s) { - UINT16 timestamp = 0; - BYTE confirmBlockNum = 0; + UINT16 timestamp; + BYTE confirmBlockNum; if (Stream_GetRemainingLength(s) < 4) return FALSE; @@ -92,6 +92,9 @@ static BOOL rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, wStream Stream_Read_UINT16(s, timestamp); Stream_Read_UINT8(s, confirmBlockNum); Stream_Seek_UINT8(s); + + IFCALL(context->ConfirmBlock, context, confirmBlockNum, timestamp); + return TRUE; } diff --git a/include/freerdp/server/rdpsnd.h b/include/freerdp/server/rdpsnd.h index e83fd231d..1dca00a11 100644 --- a/include/freerdp/server/rdpsnd.h +++ b/include/freerdp/server/rdpsnd.h @@ -33,6 +33,7 @@ typedef int (*psRdpsndStop)(RdpsndServerContext* context); typedef BOOL (*psRdpsndServerInitialize)(RdpsndServerContext* context); typedef BOOL (*psRdpsndServerSelectFormat)(RdpsndServerContext* context, int client_format_index); typedef BOOL (*psRdpsndServerSendSamples)(RdpsndServerContext* context, const void* buf, int nframes); +typedef BOOL (*psRdpsndServerConfirmBlock)(RdpsndServerContext* context, BYTE confirmBlockNum, UINT16 wtimestamp); typedef BOOL (*psRdpsndServerSetVolume)(RdpsndServerContext* context, int left, int right); typedef BOOL (*psRdpsndServerClose)(RdpsndServerContext* context); @@ -82,6 +83,10 @@ struct _rdpsnd_server_context * nframes * src_format.nBitsPerSample * src_format.nChannels / 8 */ psRdpsndServerSendSamples SendSamples; + /** + * Called when block confirm is received from the client + */ + psRdpsndServerConfirmBlock ConfirmBlock; /** * Set the volume level of the client. Valid range is between 0 and 0xFFFF. */