Question about returning unsigned long in Interfaces.cs
HopingCoding opened this issue · comments
Some MediaFoundation classes return UInt64. Example: https://docs.microsoft.com/en-us/windows/desktop/medfound/mf-mt-frame-rate-attribute
However in the autogenerated Interfaces.cs of SharpDX I could not find any GetULong() instead the GetLong() is used which casts ulong to long and therefore might cause troubles with overflows.
I am suspecting this, because the following call returns wrong framerate values in certain videos which have fractional framerates:
var mediaType = sourceReader.GetCurrentMediaType(_videoStreamIndex);
var rate = mediaType.Get(MediaTypeAttributeKeys.FrameRate); //returns 42949672960497499