Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ae999738
Commit
ae999738
authored
Feb 16, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/evr: Fix rate limits methods.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d2e6e6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
9 deletions
+45
-9
evr.c
dlls/mf/evr.c
+28
-5
mf.c
dlls/mf/tests/mf.c
+17
-4
No files found.
dlls/mf/evr.c
View file @
ae999738
...
...
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <float.h>
#define COBJMACROS
#include "mf_private.h"
...
...
@@ -2730,25 +2732,46 @@ static HRESULT WINAPI video_renderer_rate_support_GetSlowestRate(IMFRateSupport
BOOL
thin
,
float
*
rate
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFRateSupport
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"%p, %d, %d, %p.
\n
"
,
iface
,
direction
,
thin
,
rate
);
EnterCriticalSection
(
&
renderer
->
cs
);
if
(
renderer
->
flags
&
EVR_SHUT_DOWN
)
return
MF_E_SHUTDOWN
;
*
rate
=
0
.
0
f
;
hr
=
MF_E_SHUTDOWN
;
else
if
(
!
rate
)
hr
=
E_POINTER
;
else
{
*
rate
=
0
.
0
f
;
}
LeaveCriticalSection
(
&
renderer
->
cs
);
return
S_OK
;
return
hr
;
}
static
HRESULT
WINAPI
video_renderer_rate_support_GetFastestRate
(
IMFRateSupport
*
iface
,
MFRATE_DIRECTION
direction
,
BOOL
thin
,
float
*
rate
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFRateSupport
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"%p, %d, %d, %p.
\n
"
,
iface
,
direction
,
thin
,
rate
);
return
renderer
->
flags
&
EVR_SHUT_DOWN
?
MF_E_SHUTDOWN
:
MF_E_INVALIDREQUEST
;
EnterCriticalSection
(
&
renderer
->
cs
);
if
(
renderer
->
flags
&
EVR_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
if
(
!
rate
)
hr
=
E_POINTER
;
else
if
(
video_renderer_is_main_stream_configured
(
renderer
))
{
*
rate
=
direction
==
MFRATE_FORWARD
?
FLT_MAX
:
-
FLT_MAX
;
}
else
hr
=
MF_E_INVALIDREQUEST
;
LeaveCriticalSection
(
&
renderer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
video_renderer_rate_support_IsRateSupported
(
IMFRateSupport
*
iface
,
BOOL
thin
,
float
rate
,
...
...
dlls/mf/tests/mf.c
View file @
ae999738
...
...
@@ -4612,6 +4612,9 @@ todo_wine {
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_REVERSE
,
TRUE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
supported_rates
);
++
i
)
{
rate
=
supported_rates
[
i
]
+
1
.
0
f
;
...
...
@@ -4661,16 +4664,20 @@ todo_wine {
rate
=
0
.
0
f
;
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_FORWARD
,
TRUE
,
&
rate
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
FLT_MAX
,
"Unexpected rate %f.
\n
"
,
rate
);
}
rate
=
0
.
0
f
;
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
-
FLT_MAX
,
"Unexpected rate %f.
\n
"
,
rate
);
}
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_REVERSE
,
TRUE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rs
,
MFRATE_REVERSE
,
TRUE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
supported_rates
);
++
i
)
{
rate
=
supported_rates
[
i
]
+
1
.
0
f
;
...
...
@@ -4709,6 +4716,12 @@ todo_wine {
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_FORWARD
,
FALSE
,
&
rate
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rs
,
MFRATE_FORWARD
,
FALSE
,
NULL
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_FORWARD
,
FALSE
,
NULL
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
TRUE
,
1
.
0
f
,
&
rate
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment