[PATCH v4 1/3] winegstreamer: Advertise support for fast forward and slow motion.

Giovanni Mascellani gmascellani at codeweavers.com
Tue Jun 1 01:36:09 CDT 2021


Let winegstreamer's media source emit the same rate limits that Windows
exposes for media sources generated with the standard source resolver.

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 dlls/winegstreamer/media_source.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index e153c8e9161..d013a60e150 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -933,7 +933,7 @@ static HRESULT WINAPI media_source_rate_support_GetSlowestRate(IMFRateSupport *i
 {
     TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate);
 
-    *rate = direction == MFRATE_FORWARD ? 1.0f : -1.0f;
+    *rate = 0.0f;
 
     return S_OK;
 }
@@ -942,14 +942,14 @@ static HRESULT WINAPI media_source_rate_support_GetFastestRate(IMFRateSupport *i
 {
     TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate);
 
-    *rate = direction == MFRATE_FORWARD ? 1.0f : -1.0f;
+    *rate = direction == MFRATE_FORWARD ? 1e6f : -1e6f;
 
     return S_OK;
 }
 
 static HRESULT WINAPI media_source_rate_support_IsRateSupported(IMFRateSupport *iface, BOOL thin, float rate, float *nearest_support_rate)
 {
-    const float supported_rate = rate >= 0.0f ? 1.0f : -1.0f;
+    const float supported_rate = max(min(rate, 1e6f), -1e6f);
 
     TRACE("%p, %d, %f, %p.\n", iface, thin, rate, nearest_support_rate);
 
-- 
2.32.0.rc0




More information about the wine-devel mailing list