[FFmpeg-devel] probable dshow bug or strangeness

Don Moir donmoir at comcast.net
Sat Mar 8 02:34:11 CET 2014

I am posting here since not quite sure and need some advice.

I got word that some captures devices were not working. Everything enumerated and went thru but no display.

You get packets with zero size and then no decode success.

I traced this into dshow_pin.c and function libAVMemInputPin_Receive. In this function there is:

buf_size = IMediaSample_GetActualDataLength(sample);

In this case, buf_size is always zero. I think it is supposed to be set somewhere with IMediaSample_SetActualDataLength and could be a coding issue with driver.

This apparently happens enough where I can't just blame the driver if thats where it lies. Maybe it is supposed to be set in dshow_pin.c somewhere but don't know.

When this happens (buf_size == 0), the real data length appears to be returned by  IMediaSample_GetSize(sample); This is supposed to be the actual buffer length and not necessarily the data length. When I change it to use IMediaSample_GetSize it works perfect.

So just not sure how to best handle it and can't find good information about it. It appears though, IMediaSample_GetSize is the thing to use and seems  IMediaSample_GetActualDataLength can be ignored but have no real clue.

I am still running some test with it and maybe someone out there has some more info.

More information about the ffmpeg-devel mailing list