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
63fb4d82
Commit
63fb4d82
authored
Nov 08, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement INSSBuffer::SetLength().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
25adac6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
wm_reader.c
dlls/winegstreamer/wm_reader.c
+12
-5
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+22
-0
No files found.
dlls/winegstreamer/wm_reader.c
View file @
63fb4d82
...
...
@@ -172,7 +172,7 @@ struct buffer
INSSBuffer
INSSBuffer_iface
;
LONG
refcount
;
DWORD
size
;
DWORD
size
,
capacity
;
BYTE
data
[
1
];
};
...
...
@@ -231,8 +231,15 @@ static HRESULT WINAPI buffer_GetLength(INSSBuffer *iface, DWORD *size)
static
HRESULT
WINAPI
buffer_SetLength
(
INSSBuffer
*
iface
,
DWORD
size
)
{
FIXME
(
"iface %p, size %u, stub!
\n
"
,
iface
,
size
);
return
E_NOTIMPL
;
struct
buffer
*
buffer
=
impl_from_INSSBuffer
(
iface
);
TRACE
(
"iface %p, size %u.
\n
"
,
buffer
,
size
);
if
(
size
>
buffer
->
capacity
)
return
E_INVALIDARG
;
buffer
->
size
=
size
;
return
S_OK
;
}
static
HRESULT
WINAPI
buffer_GetMaxLength
(
INSSBuffer
*
iface
,
DWORD
*
size
)
...
...
@@ -241,7 +248,7 @@ static HRESULT WINAPI buffer_GetMaxLength(INSSBuffer *iface, DWORD *size)
TRACE
(
"buffer %p, size %p.
\n
"
,
buffer
,
size
);
*
size
=
buffer
->
size
;
*
size
=
buffer
->
capacity
;
return
S_OK
;
}
...
...
@@ -1754,7 +1761,7 @@ HRESULT wm_reader_get_stream_sample(struct wm_stream *stream,
object
->
INSSBuffer_iface
.
lpVtbl
=
&
buffer_vtbl
;
object
->
refcount
=
1
;
object
->
size
=
event
.
u
.
buffer
.
size
;
object
->
capacity
=
object
->
size
=
event
.
u
.
buffer
.
size
;
if
(
!
wg_parser_stream_copy_buffer
(
wg_stream
,
object
->
data
,
0
,
object
->
size
))
{
...
...
dlls/wmvcore/tests/wmvcore.c
View file @
63fb4d82
...
...
@@ -686,6 +686,17 @@ static void test_sync_reader_streaming(void)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
<=
capacity
,
"Size %u exceeds capacity %u.
\n
"
,
size
,
capacity
);
hr
=
INSSBuffer_SetLength
(
sample
,
capacity
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
INSSBuffer_SetLength
(
sample
,
capacity
-
1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
INSSBuffer_GetBufferAndLength
(
sample
,
&
data2
,
&
size
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
data2
==
data
,
"Data pointers didn't match.
\n
"
);
ok
(
size
==
capacity
-
1
,
"Expected size %u, got %u.
\n
"
,
capacity
-
1
,
size
);
ref
=
INSSBuffer_Release
(
sample
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
...
...
@@ -1222,6 +1233,17 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output,
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
<=
capacity
,
"Size %u exceeds capacity %u.
\n
"
,
size
,
capacity
);
hr
=
INSSBuffer_SetLength
(
sample
,
capacity
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
INSSBuffer_SetLength
(
sample
,
capacity
-
1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
INSSBuffer_GetBufferAndLength
(
sample
,
&
data2
,
&
size
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
data2
==
data
,
"Data pointers didn't match.
\n
"
);
ok
(
size
==
capacity
-
1
,
"Expected size %u, got %u.
\n
"
,
capacity
-
1
,
size
);
ok
(
callback
->
got_started
>
0
,
"Got %u WMT_STARTED callbacks.
\n
"
,
callback
->
got_started
);
ok
(
!
callback
->
got_eof
,
"Got %u WMT_EOF callbacks.
\n
"
,
callback
->
got_eof
);
++
callback
->
got_sample
;
...
...
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