Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/winegstreamer/media_source.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index eb5b9e366ec..397f4224c9f 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -917,13 +917,7 @@ static HRESULT WINAPI media_source_rate_support_GetSlowestRate(IMFRateSupport *i { TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate);
- if (direction == MFRATE_REVERSE) - return MF_E_REVERSE_UNSUPPORTED; - - if (thin) - return MF_E_THINNING_UNSUPPORTED; - - *rate = 1.0f; + *rate = direction == MFRATE_FORWARD ? 1.0f : -1.0f;
return S_OK; } @@ -932,31 +926,21 @@ static HRESULT WINAPI media_source_rate_support_GetFastestRate(IMFRateSupport *i { TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate);
- if (direction == MFRATE_REVERSE) - return MF_E_REVERSE_UNSUPPORTED; - - if (thin) - return MF_E_THINNING_UNSUPPORTED; - - *rate = 1.0f; + *rate = direction == MFRATE_FORWARD ? 1.0f : -1.0f;
return S_OK; }
static HRESULT WINAPI media_source_rate_support_IsRateSupported(IMFRateSupport *iface, BOOL thin, float rate, float *nearest_support_rate) { - TRACE("%p, %d, %f, %p.\n", iface, thin, rate, nearest_support_rate); + const float supported_rate = rate >= 0.0f ? 1.0f : -1.0f;
- if (rate < 0.0f) - return MF_E_REVERSE_UNSUPPORTED; - - if (thin) - return MF_E_THINNING_UNSUPPORTED; + TRACE("%p, %d, %f, %p.\n", iface, thin, rate, nearest_support_rate);
if (nearest_support_rate) - *nearest_support_rate = 1.0f; + *nearest_support_rate = supported_rate;
- return rate == 1.0f ? S_OK : MF_E_UNSUPPORTED_RATE; + return rate == supported_rate ? S_OK : MF_E_UNSUPPORTED_RATE; }
static const IMFRateSupportVtbl media_source_rate_support_vtbl =
On 5/17/21 3:13 AM, Giovanni Mascellani wrote:
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
dlls/winegstreamer/media_source.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index eb5b9e366ec..397f4224c9f 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -917,13 +917,7 @@ static HRESULT WINAPI media_source_rate_support_GetSlowestRate(IMFRateSupport *i { TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate);
- if (direction == MFRATE_REVERSE)
return MF_E_REVERSE_UNSUPPORTED;
- if (thin)
return MF_E_THINNING_UNSUPPORTED;
- *rate = 1.0f;
*rate = direction == MFRATE_FORWARD ? 1.0f : -1.0f;
return S_OK; }
@@ -932,31 +926,21 @@ static HRESULT WINAPI media_source_rate_support_GetFastestRate(IMFRateSupport *i { TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate);
- if (direction == MFRATE_REVERSE)
return MF_E_REVERSE_UNSUPPORTED;
- if (thin)
return MF_E_THINNING_UNSUPPORTED;
- *rate = 1.0f;
*rate = direction == MFRATE_FORWARD ? 1.0f : -1.0f;
return S_OK; }
static HRESULT WINAPI media_source_rate_support_IsRateSupported(IMFRateSupport *iface, BOOL thin, float rate, float *nearest_support_rate) {
- TRACE("%p, %d, %f, %p.\n", iface, thin, rate, nearest_support_rate);
- const float supported_rate = rate >= 0.0f ? 1.0f : -1.0f;
- if (rate < 0.0f)
return MF_E_REVERSE_UNSUPPORTED;
- if (thin)
return MF_E_THINNING_UNSUPPORTED;
TRACE("%p, %d, %f, %p.\n", iface, thin, rate, nearest_support_rate);
if (nearest_support_rate)
*nearest_support_rate = 1.0f;
*nearest_support_rate = supported_rate;
- return rate == 1.0f ? S_OK : MF_E_UNSUPPORTED_RATE;
return rate == supported_rate ? S_OK : MF_E_UNSUPPORTED_RATE; }
static const IMFRateSupportVtbl media_source_rate_support_vtbl =
Should this print a FIXME?
Hi,
Il 17/05/21 17:31, Zebediah Figura (she/her) ha scritto:
Should this print a FIXME?
IMHO it is especially sensible that SetRate has a FIXME, because that's where an application is manifesting its will rather than collecting information. In my (admittedly limited) experience, applications will likely call rate support functions just because their framework (e.g., Unreal Engine) does, but don't necessarily take into account that information. In that case we'd just have FIXME spamming. On the contrary, if an application wants to change rate, it will call SetRate, and that will produce a useful FIXME.
Just my two cents, no problems if it gets changed.
Giovanni.