RFR: 8074211: javax.sound.midi: Error with send System Exclusive messages of different length [v3]
Alec Su
duke at openjdk.org
Wed Nov 22 16:34:19 UTC 2023
On Mon, 30 Oct 2023 21:30:06 GMT, Phil Race <prr at openjdk.org> wrote:
>> Alec Su has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Code cleanup
>
>> It use `dwBytesRecorded` in `MIDIHDR` structure to indicate the actual size of the data
>> However, `midiOutLongMsg()` ignores `dwBytesRecorded`, although it did not mentioned in the documentation.
>
>
> This seems to be documented by Microsoft only in the most obscure fashion.
>
> If you look at the doc for midiOutPrepareHeader
> https://learn.microsoft.com/en-us/previous-versions/dd798477(v=vs.85)
> it says "Before calling the function, set the lpData, dwBufferLength, and dwFlags members of the [MIDIHDR](https://learn.microsoft.com/en-us/previous-versions/dd798449(v=vs.85)) structure"
>
> So no mention of dwBytesRecorded.
>
> WAVEHDR is a very similar struct to MIDIHDR and if you look at this WAVEHDR doc it says
>
> https://learn.microsoft.com/en-us/previous-versions/dd743837(v=vs.85)
>
> dwBytesRecorded
> When the header is used in input, specifies how much data is in the buffer.
>
> So I infer the same is true for MIDI
>
> Therefore dwBytesRecorded is only used for input and dwBufferLength is what's important for output.
@prrace @mrserb Thank you very much.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16399#issuecomment-1823098255
More information about the client-libs-dev
mailing list