Sven Baars sven.wine@gmail.com writes:
for (i = 0; i < This->enumMediaDetails.cMediaTypes; i++) {
This->enumMediaFunction(This->basePin, i,&amt);
if (FAILED(CopyMediaType(&This->enumMediaDetails.pMediaTypes[i], &amt)))
This->enumMediaFunction(This->basePin, i, &amt);
hr = CopyMediaType(&This->enumMediaDetails.pMediaTypes[i], &amt);
FreeMediaType(&amt);
The extra copy doesn't seem necessary, you could fetch directly into the destination array.