Rémi Bernon (@rbernon) commented about dlls/winegstreamer/wg_sample.c:
HRESULT wg_sample_create_mf(IMFSample *mf_sample, struct wg_sample **out) { DWORD current_length, max_length;
- LONG pitch; struct sample *sample;
- BYTE *buffer;
BYTE *buffer, *scanline; HRESULT hr;
if (!(sample = calloc(1, sizeof(*sample)))) return E_OUTOFMEMORY; if (FAILED(hr = IMFSample_ConvertToContiguousBuffer(mf_sample, &sample->u.mf.buffer))) goto fail;
- if (FAILED(hr = IMFMediaBuffer_Lock(sample->u.mf.buffer, &buffer, &max_length, ¤t_length)))
- if (SUCCEEDED(hr = IMFMediaBuffer_QueryInterface(sample->u.mf.buffer, &IID_IMF2DBuffer2, (void**)&sample->u.mf.buffer2d2)) &&
FAILED(hr = IMF2DBuffer2_Lock2DSize(sample->u.mf.buffer2d2, MF2DBuffer_LockFlags_Write, &scanline, &pitch, &buffer, &max_length)))
I wanted to try doing that, but right now we don't support buffers with pitch != width * bpp. Are we sure that it's not the case?