[WIP] Use unused bytes in CNetworkTransportProps for EAudioQuality (backwards compatible) - #3898
[WIP] Use unused bytes in CNetworkTransportProps for EAudioQuality (backwards compatible)#3898dingodoppelt wants to merge 2 commits into
Conversation
|
You may break backwards compatibility to old betas IMO. There was no real release and we should try to have a clean state for each release. |
Yes, I'm ok with breaking compatibility with beta clients, but this is an opportunity to overhaul the connection process even for non-raw qualities. We would break compatibility to all clients, if we only rely on those 4 bytes. |
|
Ok. That's fair then. |
bdbab52 to
5ac4750
Compare
|
At the moment we collect our info from different enums ( |
5ac4750 to
a95da5f
Compare
| } | ||
| } | ||
|
|
||
| Channel.SetAudioCodingArg ( eAudioQuality ); |
There was a problem hiding this comment.
This makes the server aware of the audio quality set in the client. Before that we had to guess by the packet sizes.
| const bool bIsRawAudio = | ||
| ( iCeltNumCodedBytes == static_cast<int> ( sizeof ( int16_t ) * iClientFrameSizeSamples * vecNumAudioChannels[iChanCnt] ) ); | ||
| ( vecAudioCodingArg[iChanCnt] == AQ_RAW || | ||
| iCeltNumCodedBytes == static_cast<int> ( sizeof ( int16_t ) * iClientFrameSizeSamples * vecNumAudioChannels[iChanCnt] ) ); |
There was a problem hiding this comment.
I left this in for backwards compatibility. We could deprecate this with a TODO: to be removed, same for the transmitting side.
|
🤖 AI: The size test this replaces was doing two jobs, and only one of them is visible: Now it's measured, ASan, server-only build, three UDP datagrams and no credentials:
Both write sites fire: the memcpy, and the memset on a lost packet. The declared flag is the trigger, not the packet size, and A path that keeps the direction: iAudioCodingArg arrives unvalidated — no range check, unlike every field around it, which cost nothing while nothing read it. Validating it on receipt, and keeping the size equality as a requirement rather than an alternative, gives the explicit negotiation without letting the declaration widen a copy. Separately, The reproducer is a short Python script against a stock build; I can post it here or as a gist. |
Of course we can break things if we want. The question is (and I'm not asking the AI) whether it works with a client built from main, nothing more. @mcfnord: If you have something to add personally feel free but please don't let the AI post stuff here. It isn't very helpful and its a lot of text I'd rather not have to read. |
I have tried to slash the word count, but not sure that has made things easier to read. I generally respect the policy each person sets. When you say "I doubt that's true" my AI will respond with more evidence rather than less, so just be aware of that. When you say "here" do you mean on an unmerged PR of yours, or a draft? I had set it to avoid you, but last night I flushed all my own guidance and told it to go with things each individual has said about their wishes and preferences. So you can set your own policy. Perhaps you'd prefer "don't talk about my stuff more than once a day" or "wait 72 hours before saying anything about my activities" or "never write more words to me than the word count you're responding to." All are interesting throttle ideas. |
|
No. He says that you should have probably not used AI at all. Or that the output is not concise enough. |
#3894 surfaced 4 bytes being unused in
CNetworkTransportProps, namelyiAudioCodingArg.This uses those bytes to save the selected audio quality in the client. For backwards compatibility we simply leave the old checks in place. This should be improved, hence a work in progress.
CHANGELOG: Use iAudioCodingArg in CNetworkTransportProps for EAudioQuality
Context: Fixes an issue?
fixes #3896
Does this change need documentation? What needs to be documented and how?
No, just a bug fix
Status of this Pull Request
Proof of concept (not to be merged soon);
What is missing until this pull request can be merged?
Checklist