Rémi Bernon (@rbernon) commented about dlls/dmime/segment.c:
case mmioFOURCC('M','T','h','d'): hr = midi_parser_new(stream, &midi_parser); if (FAILED(hr)) break;
This->header.mtLength = 0;
while ((hr = midi_parser_next_track(midi_parser, &track, &length)) == S_OK)
{
hr = segment_append_track(This, track, 1, 0);
IDirectMusicTrack_Release(track);
if (FAILED(hr)) break;
if (length > This->header.mtLength)
This->header.mtLength = length;
}
hr = midi_parser_parse(midi_parser, &This->header.mtLength); midi_parser_destroy(midi_parser);
I don't understand why you're removing this now.
Yes, probably it was introduced too early because nothing creates tracks, but now it's here and I expect that you will need a way to pass the created tracks to the segment?
So let's keep it so we don't have to reintroduce it later.