Log in

View Full Version : XVID decoder bug in GetActualDataLenght()


diehardii
20th January 2005, 03:11
Hi, I've tried posting to the developer list, but my emails don't seem t go through. Anyway, here it is. I know I'm ignoring stride, but it doesn't make a difference in this case. I managed to solve it by getting information from the bitmapinfoheader, but it would be nice if this worked also. I'm using Nic's decoder for it and the connections are all made in graphedit.

~Steve

Hi guys,

Sorry about posting to the dev list without an actual fix, but the
forum isn't allowing anyone to register. Anyway, I'm forcing the DShow
decoder to output YUY2 and then connecting my personal DShow transform
filter to it. In the Transform method, I am (at the moment) just
copying the image buffers over. I have in my Transform Method:

BYTE *pbSourceBuffer, *pbDestBuffer;

pSource->GetPointer(&pbSourceBuffer);
pOut->GetPointer(&pbDestBuffer);
pOut->SetActualDataLength(pSource->GetActualDataLength());
memcpy(pbDestBuffer, pbSourceBuffer, pSource->GetActualDataLength());

This invariably crashes with XVID. I've downloaded the source for the
DShow decoder, but the workspaces seem to be corrupted on my computer.

Anyways, I looked through them and it appears as if the VidInfoHeaders
are set correctly, but the changing data size based on colorspace is
not taken into account. For instance, for a 576*432 clip where I force
YUY2 I should have 497664 bytes, but the GetActualDataLength reports
995328 bytes. Using the value of 497664 works. This is consistent
across various files. I would try a fix, except for the corruption
problem. Have a good day.

~Steve