Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/mf/session.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 925a8c93d20..9aa886adee9 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -18,6 +18,7 @@
#include <stdarg.h> #include <math.h> +#include <float.h>
#define COBJMACROS
@@ -3512,12 +3513,14 @@ static HRESULT session_presentation_object_get_rate(IUnknown *object, MFRATE_DIR if (fastest) { if (SUCCEEDED(hr = IMFRateSupport_GetFastestRate(rate_support, direction, thin, &rate))) - *result = min(fabsf(rate), *result); + if (fabsf(rate) < fabsf(*result)) + *result = rate; } else { if (SUCCEEDED(hr = IMFRateSupport_GetSlowestRate(rate_support, direction, thin, &rate))) - *result = max(fabsf(rate), *result); + if (fabsf(rate) > fabsf(*result)) + *result = rate; }
IMFRateSupport_Release(rate_support); @@ -3532,7 +3535,7 @@ static HRESULT session_get_presentation_rate(struct media_session *session, MFRA struct media_sink *sink; HRESULT hr = E_POINTER;
- *result = 0.0f; + *result = fastest ? (direction == MFRATE_FORWARD ? FLT_MAX : -FLT_MAX) : 0.0f;
EnterCriticalSection(&session->cs);