On Wed Jan 25 12:00:56 2023 +0000, Jinoh Kang wrote:
Verbose explanation (you're probably already aware of this): `packet_size` is always 0. `packet_size` should be the size for the current packet. The expression `frames_available * impl->capture_wfx.nBlockAlign` should be evalulated only after `frames_available` is assigned a meaningful value.
SIZE_T packet_size = frames_available * impl->capture_wfx.nBlockAlign; if (tmp_buf_offset + packet_size > tmp_buf_size)
My guess is that you wanted to move `packet_size` declaration out of the loop, but while doing so, you accidentally took the initializer expression with it as well. In this case, you can say:
packet_size = frames_available * impl->capture_wfx.nBlockAlign; if (tmp_buf_offset + packet_size > tmp_buf_size)
Yeah was a copy past accident.