From: Giovanni Mascellani gmascellani@codeweavers.com
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
v6: only set return value on success
dlls/mf/session.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 41caf02d059..9f233295773 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
@@ -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; }