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
9cb55ea3
Commit
9cb55ea3
authored
Nov 05, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite: Return earlier on ReadSample() is stream is deselected.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a095d157
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
main.c
dlls/mfreadwrite/main.c
+19
-8
No files found.
dlls/mfreadwrite/main.c
View file @
9cb55ea3
...
...
@@ -591,10 +591,20 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface)
return
refcount
;
}
static
HRESULT
source_reader_get_stream_selection
(
const
struct
source_reader
*
reader
,
DWORD
index
,
BOOL
*
selected
)
{
IMFStreamDescriptor
*
sd
;
if
(
FAILED
(
IMFPresentationDescriptor_GetStreamDescriptorByIndex
(
reader
->
descriptor
,
index
,
selected
,
&
sd
)))
return
MF_E_INVALIDSTREAMNUMBER
;
IMFStreamDescriptor_Release
(
sd
);
return
S_OK
;
}
static
HRESULT
WINAPI
src_reader_GetStreamSelection
(
IMFSourceReader
*
iface
,
DWORD
index
,
BOOL
*
selected
)
{
struct
source_reader
*
reader
=
impl_from_IMFSourceReader
(
iface
);
IMFStreamDescriptor
*
sd
;
TRACE
(
"%p, %#x, %p.
\n
"
,
iface
,
index
,
selected
);
...
...
@@ -610,11 +620,7 @@ static HRESULT WINAPI src_reader_GetStreamSelection(IMFSourceReader *iface, DWOR
;
}
if
(
FAILED
(
IMFPresentationDescriptor_GetStreamDescriptorByIndex
(
reader
->
descriptor
,
index
,
selected
,
&
sd
)))
return
MF_E_INVALIDSTREAMNUMBER
;
IMFStreamDescriptor_Release
(
sd
);
return
S_OK
;
return
source_reader_get_stream_selection
(
reader
,
index
,
selected
);
}
static
HRESULT
WINAPI
src_reader_SetStreamSelection
(
IMFSourceReader
*
iface
,
DWORD
index
,
BOOL
selected
)
...
...
@@ -820,6 +826,7 @@ static HRESULT source_reader_read_sample(struct source_reader *reader, DWORD ind
struct
media_stream
*
stream
;
DWORD
stream_index
;
HRESULT
hr
=
S_OK
;
BOOL
selected
;
if
(
!
stream_flags
||
!
sample
)
return
E_POINTER
;
...
...
@@ -841,12 +848,16 @@ static HRESULT source_reader_read_sample(struct source_reader *reader, DWORD ind
stream_index
=
index
;
}
if
(
stream_index
>=
reader
->
stream_count
)
/* Can't read from deselected streams. */
if
(
SUCCEEDED
(
hr
=
source_reader_get_stream_selection
(
reader
,
stream_index
,
&
selected
))
&&
!
selected
)
hr
=
MF_E_INVALIDREQUEST
;
if
(
FAILED
(
hr
))
{
*
stream_flags
=
MF_SOURCE_READERF_ERROR
;
if
(
actual_index
)
*
actual_index
=
index
;
return
MF_E_INVALIDSTREAMNUMBER
;
return
hr
;
}
if
(
actual_index
)
...
...
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