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
eb927dbb
Commit
eb927dbb
authored
Apr 03, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite: Handle async reads when flush is in progress.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e81d2cf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
reader.c
dlls/mfreadwrite/reader.c
+31
-14
No files found.
dlls/mfreadwrite/reader.c
View file @
eb927dbb
...
...
@@ -1658,29 +1658,46 @@ static HRESULT source_reader_read_sample(struct source_reader *reader, DWORD ind
return
hr
;
}
static
HRESULT
WINAPI
src_reader_ReadSample
(
IMFSourceReader
*
iface
,
DWORD
index
,
DWORD
flags
,
DWORD
*
actual_index
,
DWORD
*
stream_flags
,
LONGLONG
*
timestamp
,
IMFSample
**
sample
)
static
HRESULT
source_reader_read_sample_async
(
struct
source_reader
*
reader
,
unsigned
int
index
,
unsigned
int
flags
,
unsigned
int
*
actual_index
,
unsigned
int
*
stream_flags
,
LONGLONG
*
timestamp
,
IMFSample
**
sample
)
{
struct
source_reader
*
reader
=
impl_from_IMFSourceReader
(
iface
);
struct
source_reader_async_command
*
command
;
HRESULT
hr
;
TRACE
(
"%p, %#x, %#x, %p, %p, %p, %p
\n
"
,
iface
,
index
,
flags
,
actual_index
,
stream_flags
,
timestamp
,
sample
);
if
(
actual_index
||
stream_flags
||
timestamp
||
sample
)
return
E_INVALIDARG
;
if
(
reader
->
async_callback
)
EnterCriticalSection
(
&
reader
->
cs
);
if
(
reader
->
flags
&
SOURCE_READER_FLUSHING
)
hr
=
MF_E_NOTACCEPTING
;
else
{
if
(
actual_index
||
stream_flags
||
timestamp
||
sample
)
return
E_INVALIDARG
;
if
(
SUCCEEDED
(
hr
=
source_reader_create_async_op
(
SOURCE_READER_ASYNC_READ
,
&
command
)))
{
command
->
stream_index
=
index
;
command
->
flags
=
flags
;
if
(
FAILED
(
hr
=
source_reader_create_async_op
(
SOURCE_READER_ASYNC_READ
,
&
command
)))
return
hr
;
hr
=
MFPutWorkItem
(
MFASYNC_CALLBACK_QUEUE_STANDARD
,
&
reader
->
async_commands_callback
,
&
command
->
IUnknown_iface
);
IUnknown_Release
(
&
command
->
IUnknown_iface
);
}
}
LeaveCriticalSection
(
&
reader
->
cs
);
command
->
stream_index
=
index
;
command
->
flags
=
flags
;
return
hr
;
}
hr
=
MFPutWorkItem
(
MFASYNC_CALLBACK_QUEUE_STANDARD
,
&
reader
->
async_commands_callback
,
&
command
->
IUnknown_iface
);
IUnknown_Release
(
&
command
->
IUnknown_iface
);
}
static
HRESULT
WINAPI
src_reader_ReadSample
(
IMFSourceReader
*
iface
,
DWORD
index
,
DWORD
flags
,
DWORD
*
actual_index
,
DWORD
*
stream_flags
,
LONGLONG
*
timestamp
,
IMFSample
**
sample
)
{
struct
source_reader
*
reader
=
impl_from_IMFSourceReader
(
iface
);
HRESULT
hr
;
TRACE
(
"%p, %#x, %#x, %p, %p, %p, %p
\n
"
,
iface
,
index
,
flags
,
actual_index
,
stream_flags
,
timestamp
,
sample
);
if
(
reader
->
async_callback
)
hr
=
source_reader_read_sample_async
(
reader
,
index
,
flags
,
actual_index
,
stream_flags
,
timestamp
,
sample
);
else
hr
=
source_reader_read_sample
(
reader
,
index
,
flags
,
actual_index
,
stream_flags
,
timestamp
,
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