[PATCH v2 4/4] mf: Fix computing fastest and slowest rates for the media session.
Nikolay Sivov
nsivov at codeweavers.com
Fri May 28 03:37:29 CDT 2021
On 5/28/21 10:50 AM, Giovanni Mascellani wrote:
> 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);
>
These two changes (or three) changes are separate. Second changes
default even when none of components support rate change. How did you
test this?
More information about the wine-devel
mailing list