Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Question about returning unsigned long in Interfaces.cs #1130

Open
HopingCoding opened this issue Feb 15, 2019 · 0 comments
Open

Question about returning unsigned long in Interfaces.cs #1130

HopingCoding opened this issue Feb 15, 2019 · 0 comments

Comments

@HopingCoding
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant