Nikolay Sivov (@nsivov) commented about dlls/mfplat/sample.c:
EnterCriticalSection(&sample->attributes.cs);
- if (sample->buffer_count == 1)
- {
if (SUCCEEDED(hr = copy_2d_buffer(sample->buffers[0], buffer)))
{
LeaveCriticalSection(&sample->attributes.cs);
return hr;
}
- }
It's not obvious if we should be doing that. It would depend on how Copy2DTo() works vs how CopyToBuffer() works.
If the goal is to optimize sample copier path, it would be better to introduce special paths in copier itself. E.g. for the most common one, sysmem buffer -> d3d9 surface, we could get back surface pointer and lock it directly, bypassing any MF buffer API that might introduce additional memory copying.