fix(rdpsnd): lookup the associated format from the client list

This is an index to the client list, according to:
7df64d93-7594-4035-978d-229f2b15f1bc

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2025-04-08 16:59:31 +04:00 committed by Benoît Cortier
parent 7bd92c0ce5
commit 3d7bc28b97

View file

@ -183,7 +183,13 @@ impl SvcProcessor for Rdpsnd {
match pdu {
// TODO: handle WaveInfo for < v8
pdu::ServerAudioOutputPdu::Wave2(pdu) => {
let fmt = self.get_format(pdu.format_no)?.clone();
// TODO: maybe change wave(fmt_no,..) API to avoid the need for clone()
let fmt = self
.handler
.get_formats()
.get(pdu.format_no as usize)
.ok_or_else(|| pdu_other_err!("invalid format no"))?
.clone();
let ts = pdu.audio_timestamp;
self.handler.wave(&fmt, ts, pdu.data);
return Ok(self.wave_confirm(pdu.timestamp, pdu.block_no)?.into());