GMFBridge & Type Switching

If you switch to a graph with a different audio format, we force a dynamic type change to the new format, and the audio renderer will normally perform this change correctly. To fit the code structure, I originally did this type change by attaching the new media type to a sample returned from the sink-input's GetBuffer, so that the type change would be on the sample as it was handled in the source graph and would then still be attached to the sample as it was passed downstream. However, it's possible for the decoder to clear the type change or simply discard this buffer unused, and in these cases, the type change would never be passed downstream to the audio renderer. The result is that some changes between files would result in the audio being played at the wrong sample rate.

In version, I've fixed this in two ways. The proxy sample stores the type change so that even if SetMediaType(NULL) is called on the sample, the bridge can still retrieve the type change and set it again before the sample passes downstream. Secondly, the sink input pin now has a boolean flag indicating that a type change is expected and if the next sample does not contain a type change, will apply the current source-graph type as a type change.

This update also contains fixes for the LOG output in unicode builds and correctly cleans up the notify window used for VB apps (pointed out by Sebastian Zierer).

1st March 2007