Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
ff056c3f
Commit
ff056c3f
authored
Mar 24, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Fix SetCurrentLength() for d3d9 buffer.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e66bfc83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
buffer.c
dlls/mfplat/buffer.c
+12
-1
mfplat.c
dlls/mfplat/tests/mfplat.c
+13
-5
No files found.
dlls/mfplat/buffer.c
View file @
ff056c3f
...
...
@@ -406,6 +406,17 @@ static HRESULT WINAPI d3d9_surface_buffer_Unlock(IMFMediaBuffer *iface)
return
hr
;
}
static
HRESULT
WINAPI
d3d9_surface_buffer_SetCurrentLength
(
IMFMediaBuffer
*
iface
,
DWORD
current_length
)
{
struct
memory_buffer
*
buffer
=
impl_from_IMFMediaBuffer
(
iface
);
TRACE
(
"%p, %u.
\n
"
,
iface
,
current_length
);
buffer
->
current_length
=
current_length
;
return
S_OK
;
}
static
const
IMFMediaBufferVtbl
d3d9_surface_1d_buffer_vtbl
=
{
memory_1d_2d_buffer_QueryInterface
,
...
...
@@ -414,7 +425,7 @@ static const IMFMediaBufferVtbl d3d9_surface_1d_buffer_vtbl =
d3d9_surface_buffer_Lock
,
d3d9_surface_buffer_Unlock
,
memory_buffer_GetCurrentLength
,
memory
_buffer_SetCurrentLength
,
d3d9_surface
_buffer_SetCurrentLength
,
memory_buffer_GetMaxLength
,
};
...
...
dlls/mfplat/tests/mfplat.c
View file @
ff056c3f
...
...
@@ -5852,6 +5852,7 @@ static void test_MFCreateDXSurfaceBuffer(void)
{
IDirect3DSurface9
*
backbuffer
=
NULL
,
*
surface
;
IDirect3DSwapChain9
*
swapchain
;
DWORD
length
,
max_length
;
IDirect3DDevice9
*
device
;
IMF2DBuffer2
*
_2dbuffer2
;
IMFMediaBuffer
*
buffer
;
...
...
@@ -5859,7 +5860,6 @@ static void test_MFCreateDXSurfaceBuffer(void)
BYTE
*
data
,
*
data2
;
IMFGetService
*
gs
;
IDirect3D9
*
d3d
;
DWORD
length
;
HWND
window
;
HRESULT
hr
;
LONG
pitch
;
...
...
@@ -5904,17 +5904,25 @@ static void test_MFCreateDXSurfaceBuffer(void)
IDirect3DSurface9_Release
(
surface
);
IMFGetService_Release
(
gs
);
length
=
0
;
hr
=
IMFMediaBuffer_GetMaxLength
(
buffer
,
&
length
);
max_
length
=
0
;
hr
=
IMFMediaBuffer_GetMaxLength
(
buffer
,
&
max_
length
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!!
length
,
"Unexpected length %u.
\n
"
,
length
);
ok
(
!!
max_length
,
"Unexpected length %u.
\n
"
,
max_
length
);
hr
=
IMFMediaBuffer_GetCurrentLength
(
buffer
,
&
length
);
ok
(
hr
==
S_OK
,
"Failed to get length, hr %#x.
\n
"
,
hr
);
ok
(
!
length
,
"Unexpected length %u.
\n
"
,
length
);
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
NULL
,
NULL
);
hr
=
IMFMediaBuffer_SetCurrentLength
(
buffer
,
2
*
max_length
);
ok
(
hr
==
S_OK
,
"Failed to get length, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_GetCurrentLength
(
buffer
,
&
length
);
ok
(
hr
==
S_OK
,
"Failed to get length, hr %#x.
\n
"
,
hr
);
ok
(
length
==
2
*
max_length
,
"Unexpected length %u.
\n
"
,
length
);
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
NULL
,
&
length
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
length
==
max_length
,
"Unexpected length.
\n
"
);
/* Unlock twice. */
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
...
...
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