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
9808fd97
Commit
9808fd97
authored
Aug 26, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Wrap async reader op new_context in a union.
parent
453b0a92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+16
-6
No files found.
dlls/winegstreamer/wm_asyncreader.c
View file @
9808fd97
...
...
@@ -22,6 +22,14 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wmvcore
);
union
async_op_data
{
struct
{
void
*
context
;
}
start
;
};
struct
async_op
{
enum
async_op_type
...
...
@@ -30,7 +38,7 @@ struct async_op
ASYNC_OP_STOP
,
ASYNC_OP_CLOSE
,
}
type
;
void
*
new_context
;
union
async_op_data
u
;
struct
list
entry
;
};
...
...
@@ -191,8 +199,8 @@ static DWORD WINAPI async_reader_callback_thread(void *arg)
struct
async_op
*
op
=
LIST_ENTRY
(
entry
,
struct
async_op
,
entry
);
list_remove
(
&
op
->
entry
);
if
(
op
->
new_
context
)
reader
->
context
=
op
->
new_
context
;
if
(
op
->
u
.
start
.
context
)
reader
->
context
=
op
->
u
.
start
.
context
;
hr
=
list_empty
(
&
reader
->
async_ops
)
?
S_OK
:
E_ABORT
;
switch
(
op
->
type
)
{
...
...
@@ -291,14 +299,15 @@ error:
return
hr
;
}
static
HRESULT
async_reader_queue_op
(
struct
async_reader
*
reader
,
enum
async_op_type
type
,
void
*
context
)
static
HRESULT
async_reader_queue_op
(
struct
async_reader
*
reader
,
enum
async_op_type
type
,
union
async_op_data
*
data
)
{
struct
async_op
*
op
;
if
(
!
(
op
=
calloc
(
1
,
sizeof
(
*
op
))))
return
E_OUTOFMEMORY
;
op
->
type
=
type
;
op
->
new_context
=
context
;
if
(
data
)
op
->
u
=
*
data
;
EnterCriticalSection
(
&
reader
->
callback_cs
);
list_add_tail
(
&
reader
->
async_ops
,
&
op
->
entry
);
...
...
@@ -432,6 +441,7 @@ static HRESULT WINAPI WMReader_GetOutputFormat(IWMReader *iface, DWORD output,
static
HRESULT
WINAPI
WMReader_Start
(
IWMReader
*
iface
,
QWORD
start
,
QWORD
duration
,
float
rate
,
void
*
context
)
{
union
async_op_data
data
=
{.
start
=
{.
context
=
context
}};
struct
async_reader
*
reader
=
impl_from_IWMReader
(
iface
);
HRESULT
hr
;
...
...
@@ -448,7 +458,7 @@ static HRESULT WINAPI WMReader_Start(IWMReader *iface,
else
{
wm_reader_seek
(
&
reader
->
reader
,
start
,
duration
);
hr
=
async_reader_queue_op
(
reader
,
ASYNC_OP_START
,
context
);
hr
=
async_reader_queue_op
(
reader
,
ASYNC_OP_START
,
&
data
);
}
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
...
...
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