mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
mf/session: Fix computing fastest and slowest presentation rates.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
222d2d94e0
commit
bcd2b99d95
1 changed files with 8 additions and 3 deletions
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
|
@ -3536,8 +3537,9 @@ static HRESULT session_get_presentation_rate(struct media_session *session, MFRA
|
|||
struct media_source *source;
|
||||
struct media_sink *sink;
|
||||
HRESULT hr = E_POINTER;
|
||||
float rate;
|
||||
|
||||
*result = 0.0f;
|
||||
rate = fastest ? FLT_MAX : 0.0f;
|
||||
|
||||
EnterCriticalSection(&session->cs);
|
||||
|
||||
|
@ -3545,7 +3547,7 @@ static HRESULT session_get_presentation_rate(struct media_session *session, MFRA
|
|||
{
|
||||
LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry)
|
||||
{
|
||||
if (FAILED(hr = session_presentation_object_get_rate((IUnknown *)source->source, direction, thin, fastest, result)))
|
||||
if (FAILED(hr = session_presentation_object_get_rate((IUnknown *)source->source, direction, thin, fastest, &rate)))
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3553,7 +3555,7 @@ static HRESULT session_get_presentation_rate(struct media_session *session, MFRA
|
|||
{
|
||||
LIST_FOR_EACH_ENTRY(sink, &session->presentation.sinks, struct media_sink, entry)
|
||||
{
|
||||
if (FAILED(hr = session_presentation_object_get_rate((IUnknown *)sink->sink, direction, thin, fastest, result)))
|
||||
if (FAILED(hr = session_presentation_object_get_rate((IUnknown *)sink->sink, direction, thin, fastest, &rate)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3561,6 +3563,9 @@ static HRESULT session_get_presentation_rate(struct media_session *session, MFRA
|
|||
|
||||
LeaveCriticalSection(&session->cs);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
*result = direction == MFRATE_FORWARD ? rate : -rate;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue